A Lazy Desugaring System for Evaluating Programs with Sugars.

Ziyi Yang,Yushuo Xiao,Zhichao Guan,Zhenjiang Hu
DOI: https://doi.org/10.1007/978-3-030-99461-7_14
2022-01-01
Abstract:Extending a programming language with syntactic sugars is common practice in language design. Given a core language, one can define a surface language on top of it with sugars. We propose a lazy desugaring system, which can generate the evaluation sequences of sugar programs in the syntax of the surface language. Specifically, we define an evaluation strategy on a mixed language which combines syntactic sugars with the core language. We formulate two properties, emulation and laziness , and prove that the evaluation strategy produces correct evaluation sequences. Besides, we have implemented a system based on this novel method and demonstrate its usefulness with several examples.
What problem does this paper attempt to address?