This is a simple interpreter written in Zig in order to learn it. It utilizes Pratt parsing technique.
Clone the repository
git https://github.com/xirzo/mylang && cd mylangBuild the interpreter
zig buildGet into bin directory
cd ./zig-out/binRun the executable
./mylang sample.myfn fib(n) {
if n <= 1 {
ret n;
}
ret fib(n-1) + fib(n-2);
}
println(fib(5));
- structs (as objects)
- if statements
- built-in functions (e.g. println)
- function declarations
- function calls
- blocks
- let statements
- return statements
- infix operators
- prefix operators
- postfix operators
- reassignments
- for loops
- while loops
- [] else statements