Lune

POPL2025Top-tier venue

Pantograph: A Fluid and Typed Structure Editor

Jacob Prinz, Henry Blanchette, Leonidas Lampropoulos

Abstract

Structure editors operate directly on a program's syntactic tree structure. At first glance, this allows for the exciting possibility that such an editor could enforce correctness properties: programs could be well-formed and sometimes even well-typed by construction. Unfortunately, traditional approaches to structure editing that attempt to rigidly enforce these properties face a seemingly fundamental problem, known in the literature as viscosity. Making changes to existing programs often requires temporarily breaking program structure-but disallowing such changes makes it difficult to edit programs!

In this paper, we present a scheme for structure editing which always maintains a valid program structure without sacrificing the fluidity necessary to freely edit programs. Two key pieces help solve this puzzle: first, we develop a novel generalization of selection for tree-based structures that properly generalizes text-based selection and editing, allowing users to freely rearrange pieces of code by cutting and pasting one-hole contexts; second, we type these one-hole contexts with a category of type diffs and explore the metatheory of the system that arises for maintaining well-typedness systematically. We implement our approach as an editor called Pantograph, and we conduct a study in which we successfully taught students to program with Pantograph and compare their performance against a traditional text editor.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

1 top-tier paper has cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Incremental Bidirectional Typing via Order Maintenance cites Total Type Error Localization and Recovery with Holes
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers1

  1. Incremental Bidirectional Typing via Order MaintenanceThomas Porter, Marisa Kirisame, Ivan Wei, Pavel Panchekha et al.OOPSLA 2025 · 2 citations

Builds on1

  1. Total Type Error Localization and Recovery with HolesEric Zhao, Raef Maroof, Anand Dukkipati, Andrew Blinn et al.POPL 2024 · 15 citations

Related papers

  1. Syntactic Completions with Material ObligationsDavid Moon, Andrew Blinn, Thomas Porter, Cyrus OmarOOPSLA 2025
  2. From Characters to Structure: Rethinking Real-Time Collaborative Programming ModelsLeon Freudenthaler, Bernhard Taufner, Karl Michael GöschkaASE 2025
  3. Grove: A Bidirectionally Typed Collaborative Structure Editor CalculusMichael D. Adams, Eric Griffis, Thomas Porter, Sundara Vishnu Satish et al.POPL 2025 · 3 citations
  4. Learning Structural Edits via Incremental Tree TransformationsZiyu Yao, Frank F. Xu, Pengcheng Yin, Huan Sun et al.ICLR 2021 · 32 citations
  5. Filling typed holes with live GUIsCyrus Omar, David Moon, Andrew Blinn, Ian Voysey et al.PLDI 2021 · 35 citations
Dusk over the sea between two cliffs drawn in fine vertical lines