The language was created following completion of Part III of the book Crafting Interpreters, porting the C bytecode interpreter into Rust (the implementation of Lox, with classes, closures etc. can be found on the lox branch)
In creating a grammar for a recipe-oriented language, I gained deeper insights into Pratt-parsing and stack-based compilation than the first pass through the book. I have written about the interesting challenges and alterations here
Recipe for the nth fibonacci number
- Function support and basic control flow including if-statements and while-loops
- Syntax highlighting is provided by the VSCode extension
chef-colouring(here)
To build local, clone this repository and build with
git clone git@github.com:D-J-Harris/chef.git
cargo build --releaseRun either with zero arguments as a REPL, or compile source code at the .chef or .recipe extensions
chef
chef <.chef | .recipe file>--debug_code- print out each disassembled chunk at the end of compile time--debug_trace- print out each disassembled operation during runtime
cargo testCodebases and references all MIT licensed, including this repository
- Test and benchmark files adapted from the book
- Test suite runner code inspired from loxido