An implementation of the Monkey programming language written in Rust, from Thorsten Ball's Writing an Interpreter in Go and Writing a Compiler in Go books.
I started this project to learn about how programming languages work by building an interpreter, a REPL, and eventually a compiler as well as a virtual machine.
I chose Rust instead of Go mainly for practice, and also to avoid copy-pasting the code directly from the book. Rust also seems better suited for this kind of low-level work.
I try to stay as close as possible to Thorsten's Go implementation for now as I'm still learning. I intend to add additional features later on.
cargo build
cargo test
cargo run --release --bin repl
The benchmark program measures the time required to execute a recursive Fibonacci calculation in Monkey. A single argument must be passed, indicating which engine to use for the computation: "vm" (compiler and VM) or "eval" (interpreter).
cargo run --release --bin benchmark -- vm
Distributed under the MIT License.