项目作者: Skoolin

项目描述 :
small custom language compiler (compiles to JVM - bytecode)
高级语言: JavaScript
项目地址: git://github.com/Skoolin/SkoLang.git
创建时间: 2017-03-18T13:39:57Z
项目社区:https://github.com/Skoolin/SkoLang

开源协议:

下载


SkoLang

small custom language compiler (uses JVM)

SkoLang is a small functional language.

It compiles your program from a .sko file first to a string with jasmin
assembler code and then to a .class java class file of the same name,
plus another class file for each type specified in the code.

currently in a very early stage.

SkoLang code example:

  1. import:
  2. sko.std.math
  3. int appendInts (int a, int b) {
  4. string first = toString(a);
  5. string second = toString(b);
  6. string result = append(first,second);
  7. return toInt(result);
  8. }
  9. out(appendInts(int: math.sqrt(16), 4));
  10. int[] intArray = new int[5];
  11. int i = 0;
  12. while (i < 5) {
  13. intArray[i] = i;
  14. i = i+1;
  15. }
  16. out(intArray[4]);
  17. type Integer {
  18. int number;
  19. }
  20. Integer four = new Integer(4);
  21. print(four.number);

returns “4444”.