A Surprisingly Simple Lua Compiler

被引:1
|
作者
Gualandi, Hugo Musso [1 ]
Ierusalimschy, Roberto [1 ]
机构
[1] Pontificia Univ Catolica Rio de Janeiro, Rio de Janeiro, Brazil
关键词
dynamic languages; interpreters; partial evaluation; compilers; just-in-time compilers;
D O I
10.1145/3475061.3475077
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Dynamically-typed programming languages are often implemented using interpreters, which offer several advantages in terms of portability and flexibility of the implementation. However, as a language matures and its programs get bigger, programmers may seek compilers, to avoid the interpretation overhead. In this study, we present LuaAOT, a simple ahead-of-time compiler for Lua. The compiler is derived from the Lua interpreter and it exemplifies an old idea of using partial evaluation to produce a compiler based on an existing interpreter. Our contribution is to apply this idea to a well-established programming language. We show that with a quite modest effort it is possible to implement an efficient compiler that covers the entirety of Lua, including coroutines and tail calls. The whole implementation required less than 500 lines of new code. For this effort, we reduced the running time of our benchmarks from 20% to 60%.
引用
收藏
页码:1 / 8
页数:8
相关论文
共 50 条
  • [31] Simple machine learning methods work surprisingly well for Ramanomics
    Lawrence, Celestine P.
    JOURNAL OF RAMAN SPECTROSCOPY, 2023, 54 (08) : 887 - 889
  • [32] THE SURPRISINGLY SIMPLE SOLUTIONS TO RENEWABLE ENERGY'S BIGGEST PROBLEM
    Harrabin, Roger
    NEW SCIENTIST, 2024, 247 (3500) : 36 - 39
  • [33] π: Towards a Simple Formal Semantic Framework for Compiler Construction
    Braga, Christiano
    SAC '19: PROCEEDINGS OF THE 34TH ACM/SIGAPP SYMPOSIUM ON APPLIED COMPUTING, 2019, : 1562 - 1569
  • [34] LiFT: A Surprisingly Simple Lightweight Feature Transform for Dense ViT Descriptors
    Suri, Saksham
    Walmer, Matthew
    Gupta, Kamal
    Shrivastava, Abhinav
    COMPUTER VISION-ECCV 2024, PT VII, 2025, 15065 : 110 - 128
  • [35] Phase and fluorescence imaging with a surprisingly simple microscope based on chromatic aberration
    Mandula, Ondrej
    Kleman, Jean-Philippe
    Lacroix, Francoise
    Allier, Cedric
    Fiole, Daniel
    Herve, Lionel
    Blandin, Pierre
    Kraemer, Dorothee C.
    Morales, Sophie
    OPTICS EXPRESS, 2020, 28 (02) : 2079 - 2090
  • [36] Surprisingly simple, two length-scale picture of hydrophobic interactions
    Chaimovich, Aviel
    Israelachvili, Jacob
    Shell, M. Scott
    ABSTRACTS OF PAPERS OF THE AMERICAN CHEMICAL SOCIETY, 2012, 243
  • [37] A Formalization of Typed Lua
    Maidl, Andre Murbach
    Mascarenhas, Fabio
    Ierusalimschy, Roberto
    ACM SIGPLAN NOTICES, 2016, 51 (02) : 13 - 25
  • [38] The LUA Accessibility Toolbar
    Ceipidor, Ugo Biader
    Medaglia, Carlo Maria
    Sciarretta, Eliseo
    INTERACTION DESIGN AND ARCHITECTURES, 2008, (5-6) : 49 - 52
  • [39] Sparkly: A Simple yet Surprisingly Strong TF/IDF Blocker for Entity Matching
    Paulsen, Derek
    Govind, Yash
    Doan, Anhai
    PROCEEDINGS OF THE VLDB ENDOWMENT, 2023, 16 (06): : 1507 - 1519
  • [40] The Right Kind of Strong: Surprisingly Simple Habits of a Spiritually Strong Woman.
    Bigelow, Deborah
    LIBRARY JOURNAL, 2019, 144 (06) : 58 - 59