Semantics Lifting for Syntactic Sugar
Zhichao Guan, Yiyuan Cao, Tailai Yu, Ziheng Wang, Di Wang, Zhenjiang Hu
Abstract
Syntactic sugar plays a crucial role in engineering programming languages. It offers convenient syntax and higher-level of abstractions, as witnessed by its pervasive use in both general-purpose and domain-specific contexts. Unfortunately, the traditional approach of translating programs containing syntactic sugars into the host language can lead to abstraction leakage, breaking the promise of convenience and hindering program comprehension. To address this challenge, we introduce the idea of semantics lifting that aims to statically derive self-contained evaluation rules for syntactic sugars. More specifically, we propose a semantics-lifting framework that consists of (i) a general algorithm for deriving host-independent semantics of syntactic sugars from the semantics of the host language and the desugaring rules, (ii) a formulation of the correctness and abstraction properties for a lifted semantics, and (iii) a systematic investigation of sufficient conditions that ensure a lifted semantics is provably correct and abstract. To evaluate our semantics-lifting framework, we have implemented a system named Osazone and conducted several case studies, demonstrating that our approach is flexible, effective, and practical for implementing domain-specific languages.
Ask about this paper
Ask your agent about it.
Lune has read the top-tier papers around this one, so every answer names the papers it rests on.
Your agent calls
Lunesearch_papers
Free to start. No credit card required.
Terminal
Install the CLIlune papers get 72246125-d3d3-420d-922a-e0c34de71352Related papers
- Localizing Type Errors for Syntactic Sugar by LiftingZhichao Guan, Tailai Yu, Di Wang, Zhenjiang HuOOPSLA 2026
- One down, 699 to go: or, synthesising compositional desugaringsSándor Bartha, James Cheney, Vaishak BelleOOPSLA 2021 · 2 citations
- Data flow refinement type inferenceZvonimir Pavlinovic, Yusen Su, Thomas WiesPOPL 2021 · 15 citations
- Verified Code Transpilation with LLMsSahil Bhatia, Jie Qiu, Niranjan Hasabnis, Sanjit A. Seshia et al.NeurIPS 2024 · 36 citations
- Automating Pruning in Top-Down Enumeration for Program Synthesis Problems with Monotonic SemanticsKeith J. C. Johnson, Rahul Krishnan, Thomas W. Reps, Loris D'AntoniOOPSLA 2024 · 2 citations
