Spytial — Diagramming Program Values by Spatial Refinement¶
Source: Brown PLT Blog Date Published: May 22, 2026
The Problem¶
Traditional REPLs and debuggers fail to convey complex program structures. Binary Decision Diagrams (BDDs), abstract syntax trees, and other non-trivial data structures are notoriously difficult to inspect in standard terminal-based environments.
The Approach: Declarative Spatial Refinement¶
Spytial rethinks program visualization as a declarative specification problem rather than an imperative drawing task. Instead of writing code that explicitly positions shapes and lines, users:
- Start from the raw value graph — the program's actual runtime structure
- Apply declarative rules as constraints — specifying what the diagram should show, not how to draw it
- Let the system resolve layout — the language handles spatial arrangement automatically
This turns diagramming into a specification writing activity rather than a programming one.
Key Features¶
Counterfactual Diagnostics¶
When multiple rules conflict, Spytial provides counterfactual diagnostics that help users understand why certain layouts were rejected and how to resolve conflicting spatial constraints.
Backward Execution¶
Spytial supports backward execution — constructing program values by starting from their desired diagram appearance and working backward to infer the data that would produce it.
Cross-Language Support¶
The system works with Python, Rust, and Pyret, making it broadly applicable across ecosystems.
Case Study: BDD Visualization¶
The blog post walks through a detailed example visualizing Binary Decision Diagrams across 5 refinement stages, demonstrating how complex hierarchical structures can be progressively clarified through spatial refinement rules.