Skip to content

DiscreteTom/dt0

Repository files navigation

DT0

license retsac

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.

Spec

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.

Limitations

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.

About

The minimal programming language that compiles to WebAssembly via Binaryen & retsac.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published