A compile-to-js language written in itself
So far it has a semi-functional formatter and type checker is in progress
Some of the work has been done on youtube
The results are as of bootstrapping there were ~1500 lines of toy-js vs the ~2000 lines of javascript, meaning there's been a roughly 25% reduction in code size. This is mostly due to the dataclass syntax.
- can compile the lexer
- can compile the parser
- can compile the codegen
- can format the formatter
- can format lexer
- can format parser
- can format codegen
- basic functions
- primitives (number, string)
- builtins for console
- basic let type inference
- infer array type
- lexer.lang
- #scan
- getters & instance var defs
- ... more
this snippet shows off some of the usable features so far
let ten = comptime! 5 + 5
def add(a, b)
return undefined if !a || !b
return a + b
end
print(ten)
dataclass Person(name, age)
let p = new Person("marcelle", 25)
# more, see the .lang source files for more