A Rust implementation for the Lox language in Crafting Interpreters by Robert Nystrom.
This is roughly the first interpreter from the book (jlox) not the second.
WIP
- Exceptions. Mostly turned into
Result<BLAH, String>
and liberal use of?
to propagate them up. - The visitor pattern is very pretty in c++ and friends,
match
is far more powerful so the visitor pattern is not present at all. - I use modules with function-base public interfaces. Eg. scanner (lexer) provides
scanner(file: String) -> Tokens
not some class with methods to call. I do mostly use classes as used in the book under the hood.