Fast Interpreter in Rust
The brilirs
directory contains a fast Bril interpreter written in Rust.
It is a drop-in replacement for the reference interpreter that prioritizes speed over completeness and hackability.
It implements core Bril along with the SSA, memory, char, and floating point extensions.
Read more about the implementation, which is originally by Wil Thomason and Daniel Glus.
Install
To use brilirs
you will need to install Rust. Use echo $PATH
to check that $HOME/.cargo/bin
is on your path.
In the brilirs
directory, install the interpreter with:
$ cargo install --path .
During installation, brilirs
will attempt to create a tab completions file for current shell. If this of interest, follow the instructions provided as a warning to finish enabling this.
Run a program by piping a JSON Bril program into it:
$ bril2json < myprogram.bril | brilirs
or
$ brilirs --text --file myprogram.bril
Similar to brilck, brilirs
can be used to typecheck and validate your Bril JSON program by passing the --check
flag (similar to cargo --check
).
To see all of the supported flags, run:
$ brilirs --help