.vscode | ||
bf | ||
lox | ||
src | ||
.envrc | ||
.gitignore | ||
Cargo.lock | ||
Cargo.toml | ||
COPYING | ||
flake.lock | ||
flake.nix | ||
README.md | ||
rust-toolchain.toml |
Crafting Interpreters
Using rust to implement the first part of Crafting interpreters for the FHNW PL-Circle.
All dependencies for running the respective implementations are specified in the
flake.nix
files within the project folders (look for the key buildInputs
).
Though my recommendation is to use the provided
nix flakes.
Use cargo run -- <ARGS>
to run the interpreter directly from the source code.
Specify needed arguments in place of <ARGS>
.
Usage: rox <COMMAND>
Commands:
run Run a Lox source file
repl Run a Lox REPL
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version
For example running the Game of Life implemented in brainfuck (read the source file to figure out how to use it):
RUST_LOG=info cargo run --release -- run -s ./lox/bf.lox -- bf/game_of_life.bf
Please note that some parts of the implementation have not been given enough thought.