github.com/alecgoncharow/crafting-interpreters-rs

An animated time-lapse of how alecgoncharow/crafting-interpreters-rs was built, commit by commit.

Open this visualization on its own page →

Contributors

1

Lines of Code

329

From

2020-08-06

To

2020-09-25

About alecgoncharow/crafting-interpreters-rs

This is a Rust implementation of the interpreters described in Crafting Interpreters, the popular online book about building programming language tooling. The project includes two separate interpreter implementations: a tree walk interpreter that executes an abstract syntax tree directly, and a bytecode compiler paired with a virtual machine that compiles code to bytecode before execution.

The tree walk interpreter is feature-complete for most of the language specification, including classes and inheritance, though the maintainer notes that initializer methods on classes are not yet implemented and likely won't be. The bytecode compiler and VM are still under active development, with basic infrastructure in place for numerical operations, arithmetic, and comparisons. A hashtable implementation has also been added. However, several important features remain incomplete, including variable assignment, function calls, and lexical scoping.

This project appears aimed at developers learning about interpreter design and language implementation, serving as a practical reference implementation alongside the textbook. The Rust implementation offers the advantage of type safety and performance compared to the book's reference implementations while maintaining the same architectural patterns.

Share this video