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.
机构:
Department of Computer and Information Science, Norwegian University of Science and Technology, Trondheim, Sør-TrøndelagDepartment of Computer and Information Science, Norwegian University of Science and Technology, Trondheim, Sør-Trøndelag
Houeland T.G.
Aamodt A.
论文数: 0引用数: 0
h-index: 0
机构:
Department of Computer and Information Science, Norwegian University of Science and Technology, Trondheim, Sør-TrøndelagDepartment of Computer and Information Science, Norwegian University of Science and Technology, Trondheim, Sør-Trøndelag