A Lazy Desugaring System for Evaluating Programs with Sugars

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 sur...

Full description

Saved in:
Bibliographic Details
Published inFunctional and Logic Programming Vol. 13215; pp. 243 - 261
Main Authors Yang, Ziyi, Xiao, Yushuo, Guan, Zhichao, Hu, Zhenjiang
Format Book Chapter
LanguageEnglish
Published Switzerland Springer International Publishing AG 2022
Springer International Publishing
SeriesLecture Notes in Computer Science
Online AccessGet full text
ISBN3030994600
9783030994600
ISSN0302-9743
1611-3349
DOI10.1007/978-3-030-99461-7_14

Cover

More Information
Summary: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.
Bibliography:Z. Yang and Y. Xiao—Co-first authors, contributing equally to this work.This work was partly supported by the National Key Research and Development Program of China (No. 2021ZD0110202).
ISBN:3030994600
9783030994600
ISSN:0302-9743
1611-3349
DOI:10.1007/978-3-030-99461-7_14