Crates.io | rv-plugin |
lib.rs | rv-plugin |
version | 0.1.0 |
source | src |
created_at | 2024-08-27 21:47:17.37078 |
updated_at | 2024-08-27 21:47:17.37078 |
description | A tool that allows users to generate an interactive timeline depicting ownership and borrowing events for variables in a Rust code example |
homepage | |
repository | https://github.com/rustviz/rustviz2 |
max_upload_size | |
id | 1353859 |
size | 425,253 |
RustViz is a tool that generates interactive visualizations from simple Rust programs to assist users in better understanding the Rust Lifetime and Borrowing mechanism.
RustViz is a project of the Future of Programming Lab at the University of Michigan.
RustViz generates SVG files with graphical indicators that integrate with mdbook to render interactive visualizations of ownership and borrowing related events in a Rust program. When rendered in mdbook the diagrams use embedded Javascript to display specific highlighting information. Here's a sample view of what a visualization can look like:
You can read more about the first version of RustViz in our paper.
To build from source:
rv-plugin/
cargo install --path . --locked
(this will need to be done each time you want to compile any modifications made)/test-crate/lib.rs
with your example code (this is important since the compiler won't re-compile code unless a change has been made)/test-crate/
and run cargo rv-plugin -w > output.txt
test-crate/vis*
test-ex.sh
scriptTo use mdbook: We provide an mdbook preprocessor that embeds diagrams into an mdBook. You will need to install mdbook-rustviz and follow the instructions laid out in the README.
You can also click here to use our RustViz playground.
RustViz is an educational tool meant to provide insight about Rust to beginners, it is also still actively in development, which means that it only supports a subset of all Rust features. For example, currently we do not support conditional borrowing logic, for-loops, conditional let-bindings and more. We are working to add more of these features, however RustViz is a learning tool for beginners and is not meant to encapsulate all Rust programs.
We would like to integrate information from the MIR phase of the compiler to allow for more complicated borrowing logic as well as simplify some of the work we have to do in the HIR phase.
To fix/implement:
</>
characters