Another Rust implementation of Lox, the language introduced in Crafting Interpreters by Robert Nystrom.
Tip
What makes this unique: Nothing! This Lox interpreter is just a vessel I use to learn Rust. Expect non-idiomatic and unsafe Rust here and there! Nevertheless, this might be useful to people who also follows the book with Rust.
Important
Unlike other Rust implementations out there, I don't use the Visitor pattern used in the book. It's all full on pattern matching.
- Install Rust
- REPL:
cargo run
- Executing
.lox
script:cargo run -- your_script.lox
Tip
Check out playground
dir. It contains some example Lox scripts.
Run via cargo run -- playground/{script_name}.lox
- Nystrom, Robert. Crafting interpreters. Genever Benning, 2021. [Link]