Gradual Structure Editing with Obligations
David A. Moon, Andrew Blinn, Cyrus Omar · 2023
Structure editors have long promised to facilitate a continuous dialogue between programmer and system-one uninterrupted by syntax errors, such that vital program analyses and editor services are always available. Unfortunately, structure editors are notoriously slow or difficult to use, particularly when it comes to modifying existing code. Prior designs often struggle to resolve the tension between maintaining a program's hierarchical structure and supporting the editing affordances expected of its linear projection. We propose the paradigm of gradual structure editing, which mitigates this tension by allowing for temporary disassembly of hierarchical structures as needed for text-like editing, while scaffolding these interactions by generating syntactic obligations that, once discharged, guarantee proper reassembly. This paper contributes the design and evaluation of a gradual structure editor called teen tylr. We conducted a lab study comparing teen tylr to a text editor and a traditional structure editor on structurally complex program editing tasks, and found that teen tylr helped resolve most usability problems we identified in prior work, though not all, while achieving competitive performance with text editing on most tasks. We conclude with a discussion of teen tylr's remaining limitations and design implications for future code editors and parsers.