8 releases

0.3.2 Sep 27, 2023
0.3.1 Sep 21, 2023
0.2.0 Apr 30, 2023
0.1.4 Apr 5, 2023
0.1.2 Feb 17, 2023

#431 in Text processing

Download history 3/week @ 2023-12-24 16/week @ 2024-02-25 1/week @ 2024-03-03 3/week @ 2024-03-10 132/week @ 2024-03-31

135 downloads per month
Used in mdbook-quiz

MIT license

32K SLoC

JavaScript 32K SLoC // 0.1% comments Rust 679 SLoC // 0.0% comments

Aquascope: Look Beneath the Surface of Rust

tests crates.io docs

Aquascope is a tool that generates interactive visualizations of Rust programs. These visualizations show how Rust's borrow checker "thinks" about a program, and how a Rust program actually executes. Here is a sample output of Aquascope:

Example Aquascope output

Click here for a live demo. Want to learn more about what the diagram means? Read the new ownership chapter in our Rust Book Experiment.

⚠️ Aquascope is research software and under active development! ⚠️


We provide an mdBook preprocessor that embeds Aquascope diagrams into an mdBook. To use it, you need to install the mdbook-aquascope and cargo-aquascope binaries as follows.

cargo install mdbook-aquascope --locked --version 0.3.0
rustup toolchain install nightly-2023-08-25 -c rust-src rustc-dev llvm-tools-preview miri
cargo +nightly-2023-08-25 install aquascope_front --git https://github.com/cognitive-engineering-lab/aquascope --tag v0.3.0 --locked
cargo +nightly-2023-08-25 miri setup

Note that cargo-aquascope is installed via aquascope_front and must be installed via git and with a specific nightly toolchain. The miri setup command is a necessary prerequisite to running the Aquascope interpreter.

From Source

If you want to install from source, you first need to install cargo-make, a Rust build tool, like this:

cargo install cargo-make --locked

Then you need to install Depot, a Javascript build tool, like this:

curl https://raw.githubusercontent.com/cognitive-engineering-lab/depot/main/scripts/install.sh | sh

Then you can install Aquascope from source like this:

git clone https://github.com/cognitive-engineering-lab/aquascope.git
cd aquascope
cargo make install-mdbook


First, enable mdbook-aquascope in your mdBook's book.toml like so:

# book.toml

Then add an Aquascope code block to one of your Markdown source files like this:

#fn main() {
let mut s = String::from("hello ");`[]`

Further documentation on the syntax and configuration of Aquascope blocks will be provided once the interface is more stable.

Local Playground

Running the provided playground locally is also easy. First, you'll need to follow the above from source installation instructions. Then, you can launch the server by running cargo make playground and navigate to localhost:5173 to explore.

Note, the local playground does not run the tool within a sandbox. This makes the local version quicker, but don't run any malicious programs.

Having trouble?

If you want to use Aquascope but are having trouble finding the relevant information, please leave an issue or email us at wcrichto@brown.edu and gavin.gray@inf.ethz.ch.


~417K SLoC