14  Developer guide

14.1 Updating the docs

The site is built with Quarto. You can iterate on it locally: cd docs; quarto preview

14.2 Code hygiene

We use automated tools to format the code.

cargo fmt

# Format Markdown docs
prettier --write *.md
prettier --write docs/*.qmd --parser markdown

Install prettier for Markdown.

14.3 Some tips for working with Rust

There are two equivalent ways to rebuild and then run the code. First:

cargo run --release -- devon

The -- separates arguments to cargo, the Rust build tool, and arguments to the program itself. The second way:

cargo build --release
./target/release/aspics devon

You can build the code in two ways – debug and release. There’s a simple tradeoff – debug mode is fast to build, but slow to run. Release mode is slow to build, but fast to run. For the ASPICS codebase, since the input data is so large and the codebase so small, I’d recommend always using --release. If you want to use debug mode, just omit the flag.

If you’re working on the Rust code outside of an IDE like VSCode, then you can check if the code compiles much faster by doing cargo check.

14.4 Docker

We provide a Dockerfile in case it’s helpful for running, but don’t recommend using it. If you want to, then assuming you have Docker setup:

docker build -t spc .
docker run --mount type=bind,source="$(pwd)"/data,target=/spc/data -t spc /spc/target/release/spc config/bristol.txt

This will make the data directory in your directory available to the Docker image, where it’ll download the large input files and produce the final output.