Lune

OOPSLA2025Top-tier venue

Incremental Bidirectional Typing via Order Maintenance

Thomas Porter, Marisa Kirisame, Ivan Wei, Pavel Panchekha, Cyrus Omar

Abstract

Live programming environments provide various semantic services, including type checking and evaluation, continuously as the user is editing the program. The live paradigm promises to improve the developer experience, but liveness is an implementation challenge, particularly when working with large programs. This paper specifies and efficiently implements a system that is able to incrementally update type information for a live program in response to fine-grained program edits. This information includes type error marks and information about the expected and actual type of every expression. The system is specified type-theoretically as a small-step dynamics that propagates updates through the marked and annotated program. Most updates flow according to a base bidirectional type system. Additional pointers are maintained to connect bound variables to their binding locations, with type updates traversing these pointers directly. Order maintenance data structures are employed to efficiently maintain these pointers and to prioritize the order of update propagation. We prove this system is equivalent to naive reanalysis in the Agda theorem prover, along with other important metatheoretic properties. We then provide an efficient OCaml implementation, detailing a number of impactful optimizations. We evaluate this implementation’s performance with a large stress-test and find that it is able to achieve multiple orders of magnitude speed-up compared to from-scratch reanalysis.

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

  • Interactive Data Analysis with Lively Typed Tables cites Total Type Error Localization and Recovery with Holes
  • Pantograph: A Fluid and Typed Structure Editor 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. Interactive Data Analysis with Lively Typed TablesAlexander Bandukwala, Cyrus OmarOOPSLA 2026

Builds on4

  1. A systematic approach to deriving incremental type checkersAndré Pacak, Sebastian Erdweg, Tamás SzabóOOPSLA 2020 · 16 citations
  2. Total Type Error Localization and Recovery with HolesEric Zhao, Raef Maroof, Anand Dukkipati, Andrew Blinn et al.POPL 2024 · 15 citations
  3. Pantograph: A Fluid and Typed Structure EditorJacob Prinz, Henry Blanchette, Leonidas LampropoulosPOPL 2025 · 1 citation
  4. Spineless Traversal for Layout InvalidationMarisa Kirisame, Tiezhi Wang, Pavel PanchekhaPLDI 2025

Related papers

  1. Filling typed holes with live GUIsCyrus Omar, David Moon, Andrew Blinn, Ian Voysey et al.PLDI 2021 · 35 citations
  2. Live Pattern Matching with Typed HolesYongwei Yuan, Scott Guest, Eric Griffis, Hannah Potter et al.OOPSLA 2023 · 9 citations
  3. Type error feedback via analytic program repairGeorgios Sakkas, Madeline Endres, Benjamin Cosman, Westley Weimer et al.PLDI 2020 · 24 citations
  4. Answer Refinement Modification: Refinement Type System for Algebraic Effects and HandlersFuga Kawamata, Hiroshi Unno, Taro Sekiyama, Tachio TerauchiPOPL 2024 · 8 citations
  5. Grove: A Bidirectionally Typed Collaborative Structure Editor CalculusMichael D. Adams, Eric Griffis, Thomas Porter, Sundara Vishnu Satish et al.POPL 2025 · 3 citations
Dusk over the sea between two cliffs drawn in fine vertical lines