A Lazy Desugaring System for Evaluating Programs with Sugars

被引:1
|
作者
Yang, Ziyi [1 ]
Xiao, Yushuo [2 ,3 ]
Guan, Zhichao [2 ,3 ]
Hu, Zhenjiang [2 ,3 ]
机构
[1] Natl Univ Singapore, Sch Comp, Singapore, Singapore
[2] Minist Educ, Key Lab High Confidence Software Technol, Beijing, Peoples R China
[3] Peking Univ, Sch Comp Sci, Beijing, Peoples R China
关键词
D O I
10.1007/978-3-030-99461-7_14
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页码:243 / 261
页数:19
相关论文
共 50 条
  • [31] Verifying Temporal Properties of C Programs via Lazy Abstraction
    Duan, Zhao
    Tian, Cong
    Duan, Zhenhua
    FORMAL METHODS AND SOFTWARE ENGINEERING, ICFEM 2017, 2017, 10610 : 122 - 139
  • [32] Story of Your Lazy Function's Life: A Bidirectional Demand Semantics for Mechanized Cost Analysis of Lazy Programs
    Xia, Li-yao
    Israel, Laura
    Kramarz, Maite
    Coltharp, Nicholas
    Claessen, Koen
    Weirich, Stephanie
    Li, Yao
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2024, 8 (ICFP):
  • [33] Testing and tracing lazy functional programs using QuickCheck and Hat
    Claessen, Koen
    Runciman, Colin
    Chitil, Olaf
    Hughes, John
    Wallace, Malcolm
    Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), 2004, 2638 : 59 - 99
  • [34] Theoretical foundations for the declarative debugging of lazy functional logic programs
    Cabalbero, R
    López-Fraguas, FJ
    Rodríguez-Artalejo, M
    FUNCTIONAL AND LOGIC PROGRAMMING, PROCEEDINGS, 2001, 2024 : 170 - 184
  • [35] Rules plus strategies for transforming lazy functional logic programs
    Alpuente, M
    Falaschi, M
    Moreno, G
    Vidal, G
    THEORETICAL COMPUTER SCIENCE, 2004, 311 (1-3) : 479 - 525
  • [36] Flow analysis of lazy higher-order functional programs
    Jones, Neil D.
    Andersen, Nils
    THEORETICAL COMPUTER SCIENCE, 2007, 375 (1-3) : 120 - 136
  • [37] The cache behaviour of large lazy functional programs on stock hardware
    Nethercote, N
    Mycroft, A
    ACM SIGPLAN NOTICES, 2003, 38 (02) : 44 - 55
  • [38] Lazy Repair for Addition of Fault-tolerance to Distributed Programs
    Roohitavaf, Mohammad
    Lin, Yiyan
    Kulkarni, Sandeep S.
    2016 IEEE 30TH INTERNATIONAL PARALLEL AND DISTRIBUTED PROCESSING SYMPOSIUM (IPDPS 2016), 2016, : 1071 - 1080
  • [39] The results of: Profiling large-scale lazy functional programs
    Jarvis, SA
    Morgan, RG
    IMPLEMENTATION OF FUNCTIONAL LANGUAGES, 1997, 1268 : 200 - 221
  • [40] Dynamic slicing of lazy functional programs based on redex trails
    DIA, Technical University of Madrid, Campus de Montegancedo s/n, 28660 Boadilla del Monte, Spain
    不详
    High Order Symbol Comput, 2008, 1-2 (147-192):