Lune

POPL2025Top-tier venue

Grove: A Bidirectionally Typed Collaborative Structure Editor Calculus

Michael D. Adams, Eric Griffis, Thomas Porter, Sundara Vishnu Satish, Eric Zhao, Cyrus Omar

Abstract

Version control systems typically rely on a patch language, heuristic patch synthesis algorithms like diff, and three-way merge algorithms. Standard patch languages and merge algorithms often fail to identify conflicts correctly when there are multiple edits to one line of code or code is relocated. This paper introduces Grove, a collaborative structure editor calculus that eliminates patch synthesis and three-way merge algorithms entirely. Instead, patches are derived directly from the log of the developer's edit actions and all edits commute, i.e. the repository state forms a commutative replicated data type (CmRDT). To handle conflicts that can arise due to code relocation, the core datatype in Grove is a labeled directed multi-graph with uniquely identified vertices and edges. All edits amount to edge insertion and deletion, with deletion being permanent. To support tree-based editing, we define a decomposition from graphs into groves, which are a set of syntax trees with conflicts-including local, relocation, and unicyclic relocation conflicts-represented explicitly using holes and references between trees. Finally, we define a type error localization system for groves that enjoys a totality property, i.e. all editor states in Grove are statically meaningful, so developers can use standard editor services while working to resolve these explicitly represented conflicts. The static semantics is defined as a bidirectional marking system in line with recent work, with gradual typing employed to handle situations where errors and conflicts prevent type determination. We then layer on a unification-based type inference system to opportunistically fill type holes and fail gracefully when no solution exists. We mechanize the metatheory of Grove using the Agda theorem prover. We implement these ideas as the Grove Workbench, which generates the necessary data structures and algorithms in OCaml given a syntax tree specification.

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.

3 top-tier papers have 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

  • Direct Manipulation and Natural Language Programming, Together at Last? cites Denicek: Computational Substrate for Document-Oriented End-User Programming
  • Interactive Data Analysis with Lively Typed Tables cites Total Type Error Localization and Recovery with Holes
  • Denicek: Computational Substrate for Document-Oriented End-User Programming cites Peritext: A CRDT for Collaborative Rich Text Editing
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers3

  1. Denicek: Computational Substrate for Document-Oriented End-User ProgrammingTomas Petricek, Jonathan EdwardsUIST 2025 · 2 citations
  2. Direct Manipulation and Natural Language Programming, Together at Last?Parker Ziegler, David Minh-Duy Cao, Justin Lubin, Sarah E. ChasinsOOPSLA 2026
  3. Interactive Data Analysis with Lively Typed TablesAlexander Bandukwala, Cyrus OmarOOPSLA 2026

Builds on2

  1. Peritext: A CRDT for Collaborative Rich Text EditingGeoffrey Litt, Sarah Lim, Martin Kleppmann, Peter van HardenbergCSCW 2022 · 25 citations
  2. Total Type Error Localization and Recovery with HolesEric Zhao, Raef Maroof, Anand Dukkipati, Andrew Blinn et al.POPL 2024 · 15 citations

Related papers

  1. Type-Checking CRDT ConvergenceGeorge Zakhour, Pascal Weisenburger, Guido SalvaneschiPLDI 2023 · 16 citations
  2. Composing CRDTs Convergent by ConstructionAlexander Städing Dominguez, George Zakhour, Pascal Weisenburger, Guido SalvaneschiOOPSLA 2026
  3. On the Correctness of Software MergeAkira Mori, Masatomo HashimotoASE 2025
  4. Proof Repair across Quotient Type EquivalencesCosmo Viola, Max Fan, Talia RingerOOPSLA 2025 · 1 citation
  5. Keep CALM and CRDT OnShadaj Laddad, Conor Power, Mae Milano, Alvin Cheung et al.VLDB 2023 · 13 citations
Dusk over the sea between two cliffs drawn in fine vertical lines