MCPcopy Index your code
hub / github.com/cognitive-engineering-lab/aquascope

github.com/cognitive-engineering-lab/aquascope @v0.4.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.4.0 ↗ · + Follow
734 symbols 1,842 edges 71 files 64 documented · 9%

Browse by type

Functions 571 Types & classes 163
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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! If you encounter a bug, we welcome contributions! 🧪⚠️

Installation

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.7
rustup toolchain install nightly-2024-12-15 -c rust-src -c rustc-dev -c llvm-tools-preview -c miri
cargo +nightly-2024-12-15 install aquascope_front --git https://github.com/cognitive-engineering-lab/aquascope --tag v0.3.7 --locked
cargo +nightly-2024-12-15 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

Usage

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

# book.toml
[preprocessor.aquascope]

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

```aquascope,interpreter
#fn main() {
let mut s = String::from("hello ");`[]`
s.push_str("world");`[]`
#}
```

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

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 gavinleroy@brown.edu.

Citation

Aquascope was developed as a part of our academic research on how people learn Rust. If you use Aquascope as a part of your research, please cite this paper:

@article{cgk:aquascope,
  author = {Crichton, Will and Gray, Gavin and Krishnamurthi, Shriram},
  title = {A Grounded Conceptual Model for Ownership Types in Rust},
  year = {2023},
  issue_date = {October 2023},
  publisher = {Association for Computing Machinery},
  address = {New York, NY, USA},
  volume = {7},
  number = {OOPSLA2},
  url = {https://doi.org/10.1145/3622841},
  doi = {10.1145/3622841},
  journal = {Proc. ACM Program. Lang.},
  month = {oct},
  articleno = {265},
  numpages = {29},
  keywords = {Rust, concept inventory, ownership types, program state visualization}
}

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 338
Function 233
Class 102
Interface 34
Enum 27

Languages

Rust72%
TypeScript28%

Modules by API surface

frontend/packages/leader-line/src/leader-line.js63 symbols
crates/aquascope/src/analysis/stepper/segmented_mir.rs60 symbols
crates/aquascope/src/interpreter/step.rs38 symbols
crates/aquascope/src/analysis/permissions/context.rs36 symbols
crates/aquascope/src/analysis/mod.rs35 symbols
frontend/packages/aquascope-editor/src/editor-utils/interpreter.tsx33 symbols
crates/aquascope/src/analysis/stepper/hir_steps.rs28 symbols
crates/aquascope/src/analysis/boundaries/mod.rs24 symbols
frontend/packages/aquascope-editor/src/editor-utils/misc.tsx20 symbols
crates/aquascope/src/analysis/stepper/mod.rs20 symbols
frontend/packages/aquascope-editor/src/editor-utils/stepper.tsx19 symbols
frontend/packages/aquascope-editor/src/lib.tsx18 symbols

For agents

$ claude mcp add aquascope \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page