Lune

POPL2024顶会

Total Type Error Localization and Recovery with Holes

Eric Zhao, Raef Maroof, Anand Dukkipati, Andrew Blinn, Zhiyi Pan, Cyrus Omar

摘要

Type systems typically only define the conditions under which an expression is well-typed, leaving ill-typed expressions formally meaningless. This approach is insufficient as the basis for language servers driving modern programming environments, which are expected to recover from simultaneously localized errors and continue to provide a variety of downstream semantic services. This paper addresses this problem, contributing the first comprehensive formal account of total type error localization and recovery: the marked lambda calculus. In particular, we define a gradual type system for expressions with marked errors, which operate as non-empty holes, together with a total procedure for marking arbitrary unmarked expressions. We mechanize the metatheory of the marked lambda calculus in Agda and implement it, scaled up, as the new basis for Hazel, a full-scale live functional programming environment with, uniquely, no meaningless editor states.

The marked lambda calculus is bidirectionally typed, so localization decisions are systematically predictable based on a local flow of typing information. Constraint-based type inference can bring more distant information to bear in discovering inconsistencies but this notoriously complicates error localization. We approach this problem by deploying constraint solving as a type-hole-filling layer atop this gradual bidirectionally typed core. Errors arising from inconsistent unification constraints are localized exclusively to type and expression holes, i.e., the system identifies unfillable holes using a system of traced provenances, rather than localized in an ad hoc manner to particular expressions. The user can then interactively shift these errors to particular downstream expressions by selecting from suggested partially consistent type hole fillings, which returns control back to the bidirectional system. We implement this type hole inference system in Hazel.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 9 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Code Style Sheets: CSS for Code 引用了 Getting into the Flow: Towards Better Type Error Messages for Constraint-Based Type Inference
  • Usability Barriers for Liquid Types 引用了 Getting into the Flow: Towards Better Type Error Messages for Constraint-Based Type Inference
  • Statically Contextualizing Large Language Models with Typed Holes 引用了 Live Pattern Matching with Typed Holes
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper9

  1. Statically Contextualizing Large Language Models with Typed HolesAndrew Blinn, Xiang Li, June Hyung Kim, Cyrus OmarOOPSLA 2024 · 10 次引用
  2. Code Style Sheets: CSS for CodeSam Cohen, Ravi ChughOOPSLA 2025 · 5 次引用
  3. Usability Barriers for Liquid TypesCatarina Gamboa, Abigail Reese, Alcides Fonseca, Jonathan AldrichPLDI 2025 · 4 次引用
  4. Grove: A Bidirectionally Typed Collaborative Structure Editor CalculusMichael D. Adams, Eric Griffis, Thomas Porter, Sundara Vishnu Satish 等POPL 2025 · 3 次引用
  5. Incremental Bidirectional Typing via Order MaintenanceThomas Porter, Marisa Kirisame, Ivan Wei, Pavel Panchekha 等OOPSLA 2025 · 2 次引用

它引用的 Paper2

  1. Getting into the Flow: Towards Better Type Error Messages for Constraint-Based Type InferenceIshan Bhanuka, Lionel Parreaux, David Binder, Jonathan Immanuel BrachthäuserOOPSLA 2023 · 12 次引用
  2. Live Pattern Matching with Typed HolesYongwei Yuan, Scott Guest, Eric Griffis, Hannah Potter 等OOPSLA 2023 · 9 次引用

相关 Paper

  1. Localizing Type Errors for Syntactic Sugar by LiftingZhichao Guan, Tailai Yu, Di Wang, Zhenjiang HuOOPSLA 2026
  2. Filling typed holes with live GUIsCyrus Omar, David Moon, Andrew Blinn, Ian Voysey 等PLDI 2021 · 35 次引用
  3. Interactive Data Analysis with Lively Typed TablesAlexander Bandukwala, Cyrus OmarOOPSLA 2026
  4. Type Inference LogicsDenis Carnier, François Pottier, Steven KeuchelOOPSLA 2024 · 3 次引用
  5. Numerical Fuzz: A Type System for Rounding Error AnalysisAriel E. Kellison, Justin HsuPLDI 2024 · 4 次引用
黄昏的海面,两侧是细线勾勒的悬崖