1. A Cheap Implementation of Resugaring in BIRDS Based on Bidirectional Transformation
- Author
-
Xing Zhang, Zhenjiang Hu, and Van-Dang Tran
- Subjects
Sequence ,Recursion ,Programming language ,Process (engineering) ,Computer science ,media_common.quotation_subject ,020207 software engineering ,02 engineering and technology ,computer.software_genre ,Datalog ,TheoryofComputation_MATHEMATICALLOGICANDFORMALLANGUAGES ,Debugging ,Syntactic sugar ,0202 electrical engineering, electronic engineering, information engineering ,020201 artificial intelligence & image processing ,Syntactic structure ,Function (engineering) ,computer ,Core language ,Abstraction (linguistics) ,media_common ,computer.programming_language - Abstract
Syntactic sugar refers to a certain syntactic structure added to the programming language. This syntactic structure has no effect on the function of the language, but is more convenient for programmers to use. Since syntactic sugar will be translated to the basic syntactic structure of the core language at the compilation stage, the relationship between the source program written with syntactic sugar and the execution of the core program is masked, and the compiled program is unfamiliar to programmers. It is not convenient for programmers to learn and debug source programs written with syntactic sugar. To solve that problem, this paper adopts the idea of resugaring for automatically transforming the evaluation sequence of the core language into the evaluation sequence of the surface language, and gives a cheap implementation using the existing bidirectional transformation tool BIRDS. The resugaring algorithms for both non-recursive and recursive desugaring transformations are implemented using Datalog, and the solutions to maintain two important properties of emulation and abstraction in the process of resugaring are studied.
- Published
- 2020
- Full Text
- View/download PDF