The minimal programming language that compiles to WebAssembly via Binaryen. This is used to test/demo retsac. This is also suitable for beginners to learn how to create a compiler.
Since this is a minimal language, any advanced language features will not be implemented: struct, enum, class, closure, array, etc.
Since retsac already makes it intuitive to create a compiler, I recommend you to read the source code directly to understand the grammar specs.
For lexical specs, see this file.
For grammar rules, see this folder.
For simplicity, these limitations are enforced by design:
- You can't define functions inside functions.
- No type system,
i32
is the only type. - Every function is exported.
- Local variables defined in if/while blocks are accessible outside the block.