rvsdg
rvsdg is a Rust library for constructing and analyzing
Regionalised Value State Dependence Graphs.
The crate provides a mostly type-safe API for building RVSDGs, connecting ports with pathfinding, and handling transformation of recursive lambdas into RecEnv (phi) nodes automatically.
Terminology
For developer familiarity and personal preference, most node kinds have been renamed.
Gamma->SwitchTheta->DoWhileDelta->GlobalVPhi->RecEnvOmega->TranslationUnit
Example
use ;
let mut ctx = new;
let = ctx.add_lambda_node;
ctx.in_region;
let apply_input = ctx.add_apply_node;
ctx.connect;
Exporting and Visualization
If rvsdg-viewer is installed, you
can visualize the graph with:
ctx.open_rvsdg_viewer;
Custom Nodes
For simple custom nodes, implement NodeKind and construct the node with
Context::add_node:
use ;
;
node_kind_impl!;
More advanced node behavior can be customized through Context::node_hooks_mut.
Status
This crate is currently acting as an experiment on whether its viable to create a standalone RVSDG implementation. Longterm goal is use it for the lumina programming language.