eshom/monkey3
Monkey Interpreter in zig (third re-write) following Thorsten Ball's book
This is an implementation of monkey language as presented in the book "Writing An Interpreter In Go" It is written in zig.
While the language works, it is quite buggy with bad management design that could be better. However, the book and this repo are intended to be a learning experience, so do not expect anything more than that.
Supported OS: Linux and Windows It may also work with MacOS but I do not own a Mac.
Compiled and tested with zig 0.16.0-dev.724+2e31077fe
zig build -Doptimize=ReleaseFast
On Linux, you can get a nicer REPL experience by linking GNU Readline which depends on libc.
zig build -Doptimize=ReleaseFast -Dreadline
There are two modes, REPL and script execution.
REPL:
./zig-out/bin/monkey3
Script:
./zig-out/bin/monkey3/ ./examples/fibonacci.monkey