An implementation of the Lox programming language.
Lox is a dynamically typed, interpreted scripting language. It was designed by Bob Nystrom for his book Crafting Interpreters.
This library aims to implement Lox faithfully to the quasi-specification laid out in the book, as well as some language extensions suggested as exercises to the reader. It is loosely based off of the book's third part, which is a guide to implementing an interpreter in C.
Included in this package (and installable via
cargo install lox_lang) is a small wrapper
loxi. It is the simplest route to trying out the Lox language.
let mut my_vm = lox_lang::VM::default(); my_vm.interpret(r#" print "hello " + "world"; "#).unwrap();
Compilation and runtime errors in the Lox VM.
The Lox virtual machine.
Where in the pipeline an error occurred.
Underlying representation of runtime values in Lox.
A natively-implemented function that can be called from Lox code.