This project is an implementation of the Lox tree-walk interpreter from Crafting Interpreters. The original book uses Java for the first part, but what is a sane developer's Java? Haskell, of course! It would be nice to implement the second part, which is originally in C, in Rust. As we all know, a good developer's C is Rust.
Special thanks to Serhii for all the support during this project.
This project uses Cabal, a build system for Haskell. To run the project, follow these steps:
- Install Cabal if you haven't already.
- Navigate to the project directory.
- Run
cabal build
to build the project. - Run
cabal run
to execute the project.
These are the chapters from the book, I'll be using this to track progress:
- Scanning
- Representing Code
- Parsing Expressions
- Evaluating Expressions
- Statements and State
- Control Flow
- Functions
- Resolving and Binding (Won't do resolving, since my implementation works properly already)
-
ClassesThe book says I can skip it if I don't like writing classes, and I don't!!! -
Inheritance
Moving on to the JIT part in Rust!