Diagramming Program Values by Spatial Refinement
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.
Authors
- Siddhartha Prasad (ORCID: https://orcid.org/0000-0001-7936-8147)
- Shriram Krishnamurthi (ORCID: https://orcid.org/0000-0001-5184-1975)
- Karan Kashyap
- Tim Nelson (ORCID: https://orcid.org/0000-0002-9377-9943)
- Michael Tu (ORCID: https://orcid.org/0009-0003-7938-1319)
Institutions
- Brown University (US)
Publication Details
- Journal
- Proceedings of the ACM on Programming Languages
- Published
- 2026-06-08
- DOI
- https://doi.org/10.1145/3808275
- Primary Topic
- Logic, programming, and type systems
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- National Science Foundation
- Brown University