MCPcopy Index your code
hub / github.com/ChristianSchott/boris

github.com/ChristianSchott/boris @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
463 symbols 1,258 edges 45 files 52 documented · 11%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

BORIS - A BORrow vISualizer for Rust programs

This tool tries to visualize Rust's memory management, especially ownership transfer and borrows. Aiming to make these concepts easier to grasp for beginners, and experienced programmers switching from other languages.

This project was part of my master's thesis at the Julius-Maximilians-University Würzburg.

For now it is a standalone program, but IDE integration may be something to look into for the future.

>> Web viewer <<

Limitations

  • no borrow checker (no dependency unstable rust compiler hooks, or polonius).
  • no (/limited) error visualizations. However, the visualizations should still be useful while debugging borrow checker errors.
  • complex lifetime annotations: at the time of writing the thesis, rust analyzer did not lower lifetime annotations properly yet, meaning that any struct test<'a, 'b> {} will be treated as struct test<'a, 'a> {}
  • async
  • unsafe (interior mutability, inline assembly, etc.)
  • bugs and messy code :)

Check chapter 6.1 of the thesis for a more detailed breakdown of the limitations.

Crates

  • boris_shared: data structures shared between the backend analysis, and rendering code
  • boris_analysis: the core analysis code, depending on rust analyzer
  • boris_renderer: code for rendering the analysis results
  • boris_app: a standalone app, combining the analysis backend with a very basic frontend window
  • boris_viewer: a WASM compatible frontend, for embedding into websites (without the analysis backend)
  • boris_exporter: an internal tool for exporting/serializing analysis outputs, and creating graphics for the thesis

Compilation

App:

  • cargo run -p boris_app --release to run the main application

WASM Viewer:

  • run trunk serve in the boris_viewer folder for running the web viewer application locally. More information about deploying can be found here.
  • the viewer directly embeds pre-analysed function bodies from the ./example/export/bodies/ folder (see ./project/boris_viewer/examples.rs)
  • access examples via url/#example_name (e.g., https://christianschott.github.io/boris-viewer/#ownership)

Related Works:

Credits

It is based on the powerful rust-analyzer crate, making this whole project even possible. For the rendering it utilizes egui, as it provided a very fast and simple way for drawing to the screen.

Core symbols most depended-on inside this repo

iter
called by 160
project/boris_analysis/src/body_walker.rs
get
called by 69
project/boris_analysis/src/body_walker.rs
iter
called by 67
project/boris_renderer/src/drawer.rs
append_horizontal
called by 49
project/boris_renderer/src/drawer.rs
clone
called by 49
project/libs/la-arena/src/lib.rs
append_def
called by 41
project/boris_renderer/src/body_drawer.rs
cached_literal
called by 39
project/boris_renderer/src/drawer.rs
insert
called by 34
project/libs/la-arena/src/map.rs

Shape

Method 300
Function 63
Class 58
Enum 42

Languages

Rust100%

Modules by API surface

project/boris_renderer/src/drawer.rs100 symbols
project/boris_analysis/src/body_walker.rs58 symbols
project/libs/la-arena/src/lib.rs45 symbols
project/boris_shared/src/lib.rs40 symbols
project/libs/la-arena/src/map.rs37 symbols
project/boris_analysis/src/builder.rs35 symbols
project/boris_analysis/src/move_path.rs24 symbols
project/boris_renderer/src/body_drawer.rs22 symbols
project/boris_app/src/lib.rs19 symbols
project/boris_analysis/src/analysis.rs12 symbols
project/boris_shared/src/operators.rs8 symbols
project/boris_renderer/src/view.rs8 symbols

For agents

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

⬇ download graph artifact