binit@ktm:~$ cat crust/README.md
Crust● active
A small typed programming language with its own bytecode compiler and stack virtual machine, written from scratch in Rust. Source goes through lexing, parsing, and type checking, then compiles to bytecode that runs on a stack VM with call frames.
- + typed AST and type checking
- + int and float arithmetic
- + if / else, for loops
- + recursive function calls
- + formatted printing with {}
- + bytecode disassembler + benchmarks
samples/recursion.crust
fn factorial(n: i64) -> i64 {
if n == 0 {
return 1;
} else {
return n * factorial(n - 1);
}
}
fn main() -> void {
print("5! = {}", factorial(5));
}recursive fib(30), mean run time
1.6× fasterthan Python 3.14 on this benchmark