Lox in Rust is an Lox interpreter written in rust following the book Crafting Interpreters.
Clone the repo to local directory and install Rust and cargo. Then run
cargo run
to enter the REPL mode. An example lox file is included in test/test.lox. You can run by
cargo run test/test.lox
to run the script.
The author follows the code of Crafting Interpreters and the function should be the similar to the interpreter in the book with following differences.
- The "For" statement is not implemented.
- The global function environment is not implemented.
- The error message is not unified and quite chaotic in my implementation. And some necessary checks on "this" and "super" statement are omitted.
The detailed differences between implementations can be found in my blog 【井蛙语海】Rust (only in Chinese though).
The development of the project is stopped now.