- Rust 100%
| ast | ||
| backend | ||
| examples | ||
| parser | ||
| std | ||
| typechecker | ||
| zergc | ||
| .gitignore | ||
| Cargo.toml | ||
| LICENSE | ||
| numbers.zerg | ||
| printing.zerg | ||
| README.md | ||
Zerg Lang
What is Zerg
Zerg is a research programming language focusing on experimenting with the idea that you can build a fully featured compiler by doing the following:
- Implement an compile time interpreter for special functions in the language.
- Provide an interface for the compile time executed code to manipulate compiler state.
- Make a core library that wraps the minimal api that can now target arbitrary machine architecture.
TLDR
Using compile time execution, we can make the code generation part of a language small and open the door to niche optimizations by allowing direct access to the code generation process.
Targets
Right now Zerg only targets WASI WASM for its simple stack-based virtual machine. In the future it would be great to support actual hardware like x86 and Arm but register machines are notoriously hard to compile for. The goal is to research compile time execution, not implement a register allocation algorithm.
How to use
First, have the Rust toolchain installed.
Then run cargo build --release to build a release build of the compiler.
To run the compiler ./target/release/zergc <file name> to run the compiler on that file.
Imports will be automatically looked up following the path structure.
To import the use the standard library, use -s and the path to the standard library.