Diagramming Program Values by Spatial Refinement
Siddhartha Prasad, Michael Tu, Karan Kashyap, Tim Nelson, Shriram Krishnamurthi
ACM SIGPLAN Conference on Programming Language Design and Implementation, 2026
Abstract
Diagrams enable programmers to reason, debug, and communicate. However, constructing diagrams for programming language data is unnecessarily hard. We present a declarative DSL, SPYTIAL, that captures the essential spatial features of data. We endow SPYTIAL with a spatial semantics, mapping values to the 2D plane, and prove key properties. SPYTIAL uses constraint-solving to make interactive renderings. We show how SPYTIAL can be embedded in three very different languages: Python, Rust, and Pyret. We present a novel counterfactual debugging aid for diagramming errors, combining textual and visual output. We evaluate the language and system for expressiveness, performance, and diagnostic quality. Finally, we also show how SPYTIAL can be used to construct values interactively and visually while preserving spatial constraints.
Comment
Get the software to try it out!
Blog
See our post for a quick overview.Paper
These papers may differ in formatting from the versions that appear in print. They are made available only to support the rapid dissemination of results; the printed versions, not these, should be considered definitive. The copyrights belong to their respective owners.