rust skeleton

This commit is contained in:
Sebastian Hugentobler 2025-02-06 11:34:46 +01:00
parent 754713697d
commit 818816d16d
11 changed files with 710 additions and 1 deletions

View file

@ -3,9 +3,34 @@
Implementing [Crafting interpreters](https://craftinginterpreters.com) for the
[FHNW](https://www.fhnw.ch) [PL-Circle](https://github.com/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](https://nixos.wiki/wiki/Flakes).
## [Java Implementation](./java/lox-interpreter/)
Implementation of the tree-walk interpreter in java after the book.
Run `mvn package` to create an executable jar file in the `target` directory and
`mvn exec:java` to get a repl.
## [Rust implementation](./rust/rox/)
Implementation of the tree-walk interpreter in rust.
Use `cargo run -- <ARGS>` to run the interpreter directly from the source code.
Specify needed arguments in place of `<ARGS>`.
```
Usage: rox <COMMAND>
Commands:
compile Compile 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
```