journal article
Apr 10, 2026
Localizing Type Errors for Syntactic Sugar by Lifting
Proceedings of the ACM on Programming Languages
Vol. 10
No. OOPSLA1
pp. 1459-1485
·
Association for Computing Machinery (ACM)
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 Stellar framework, which automatically lifts the core language's typing rules to the surface language while enabling error localization in the surface syntax. Stellar also ensures that the reported errors are fixable by incorporating extra premises into the lifted typing rules. We implement provenance 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 provenance can help surface programmers address type errors more effectively, enhancing the practicality of syntactic sugar in language engineering.
Topics
No keywords indexed for this article. Browse by subject →
References
30
[2]
[3]
[5]
Holger Gast. 2005. Explaining ML Type Errors by Data Flows. In Implementation and Application of Functional Languages, Clemens Grelck, Frank Huch, Greg J. Michaelson, and Phil Trinder (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 72–89. isbn:978-3-540-32038-8
[6]
[7]
Zhichao Guan Tailai Yu Di Wang and Zhenjiang Hu. 2026. Artifact for OOPSLA’26: Localizing Type Errors for Syntactic Sugar by Lifting. https://doi.org/10.5281/zenodo.18806155 10.5281/zenodo.18806155
10.5281/zenodo.18806155
[8]
Bastiaan Heeren. 2005. Top quality type error Messages. https://api.semanticscholar.org/CorpusID:33906534
[9]
[11]
Gérard Huet. 1976. Resolution d’equations dans les langages d’ordre 1 2 ... omega. Ph. D. Dissertation. Université de Paris VII.
[16]
Simon Marlow et al. 2010. Haskell 2010 language report.
[17]
Bruce McAdam. 1998. On the Unification of Substitutions in Type Inference. Lecture Notes in Computer Science, 1595 (1998), 10.
[19]
Justin Pombrio. 2018. Resugaring: Lifting Languages through Syntactic Sugar.. Ph. D. Dissertation.
[21]
[23]
Jeremy Siek and Walid Taha. 2006. Gradual typing for functional languages. Scheme and Functional Programming.
[25]
Philip Wadler and Robert Bruce Findler. 2009. Well-Typed Programs Can’t Be Blamed. In Programming Languages and Systems, Giuseppe Castagna (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg. 1–16. isbn:978-3-642-00590-9
[27]
Martin P. Ward. 1994. Language-Oriented Programming. Softw. Concepts Tools, 15 (1994), 147–161.
[30]
Metrics
0
Citations
30
References
Details
- Published
- Apr 10, 2026
- Vol/Issue
- 10(OOPSLA1)
- Pages
- 1459-1485
Authors
Funding
National Natural Science Foundation of China
Award: W2411051
Cite This Article
Zhichao Guan, Tailai Yu, Di Wang, et al. (2026). Localizing Type Errors for Syntactic Sugar by Lifting. Proceedings of the ACM on Programming Languages, 10(OOPSLA1), 1459-1485. https://doi.org/10.1145/3798253
Related
You May Also Like
code2vec: learning distributed representations of code
Uri Alon, Meital Zilberstein · 2019
880 citations
Grounded Copilot: How Programmers Interact with Code-Generating Models
Shraddha Barke, Michael B. James · 2023
275 citations