paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Localizing Type Errors for Syntactic Sugar by Lifting

通过提升定位语法糖的类型错误
OOPSLA 10(OOPSLA1)2026匹配度 2/10 · 该论文研究语法糖类型错误的定位与报告,属于类型系统与语言设计方向,未涉及LLM/Agent、浮点程序分析或贝叶斯程序分析,与用户核心研究方向(PL与AI交叉)不匹配。引用 0 inbox
Zhichao Guan, Tailai Yu, Di Wang, Zhenjiang Hu
crossref: 2026-09-10

AI 速览

一句话:提出 Stellar 框架,通过提升核心语言类型规则,在表层语法中精确定位并报告可修复的语法糖类型错误。

语法糖通过表层语言提供直观语法来提升核心语言可用性,但其与核心语言类型检查器的交互常导致表层程序员难以理解的类型错误。现有类型提升技术能自动推断语法糖的类型规则,却无法直接在表层语法中定位错误。本文研究语法糖类型错误的定位与报告问题,应对精确定位与保证可修复两个挑战。受 marked lambda calculus (MLC) 启发,作者提出带错误来源和位置追踪的核心语言 ℓMLC,并在此基础上设计 Stellar 框架:自动将核心语言类型规则提升到表层语言,在表层语法中实现错误定位,同时通过在提升规则中加入额外前提保证报错可修复。作者实现 Stellar,并在多种具有不同类型结构的表层语言上评估,结果表明该方法能精确定位错误,避免无帮助地引用核心语言构造,帮助表层程序员更有效地处理类型错误,提升语法糖在语言工程中的实用性。

问题
语法糖与核心语言类型检查器交互时,错误信息常引用核心语言构造,表层程序员难以理解;现有类型提升技术不直接在表层语法中定位错误。
方法
提出带错误来源和位置追踪的核心语言 ℓMLC,并设计 Stellar 框架自动提升类型规则到表层语言,同时加入额外前提以保证报告的错误可在表层语法中被定位和修复。
评估
实现 Stellar 并在多种具有不同类型结构的表层语言上评估,显示其能精确定位类型错误、避免无帮助地引用核心语言构造,并帮助表层程序员更有效地修复错误。
原文摘要(Abstract)

Syntactic sugar enhances the usability of a core language by providing intuitive syntax in a surface language; however, its interaction with the core-language type checker often results in error messages that are unclear to surface programmers. Existing techniques, such as type lifting, can automatically infer typing rules for syntactic sugar, but they do not consider localizing type errors directly in the surface syntax. This paper studies the problem of localizing and reporting type errors for syntactic sugar, addressing two key challenges: precisely localizing errors and ensuring that they are fixable. Inspired by the recently proposed marked lambda calculus (MLC), we develop ℓ MLC as our core language which tracks error provenance and locations via type annotations. Building on this, we propose the Ste llar framework, which automatically lifts the core language’s typing rules to the surface language while enabling error localization in the surface syntax. Ste llar also ensures that the reported errors are fixable by incorporating extra premises into the lifted typing rules. We implement Ste llar and evaluate it across various surface languages with different type structures, demonstrating that our approach precisely localizes errors and avoids unhelpful references to core-language constructs. Our evaluation suggests that Ste llar can help surface programmers address type errors more effectively, enhancing the practicality of syntactic sugar in language engineering.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot3822,
  title = {Localizing Type Errors for Syntactic Sugar by Lifting},
  author = {Zhichao Guan and Tailai Yu and Di Wang and Zhenjiang Hu},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {10},
  number = {OOPSLA1},
  year = {2026},
  doi = {10.1145/3798253}
}