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 条
  • [41] Simple and surprisingly accurate approach to the chemical bond obtained from dimensional scaling
    Svidzinsky, AA
    Scully, MO
    Herschbach, DR
    PHYSICAL REVIEW LETTERS, 2005, 95 (08)
  • [42] A surprisingly simple correlation between the classical and quantum structural networks in liquid water
    Hamm, Peter
    Fanourgakis, George S.
    Xantheas, Sotiris S.
    JOURNAL OF CHEMICAL PHYSICS, 2017, 147 (06):
  • [43] THE EXPERIMENT The DNA Structure: Surprisingly simple Models for the most important Molecule of Life
    Quadbeck-Seeger, Hans-Juergen
    CHEMIE IN UNSERER ZEIT, 2017, 51 (04) : 284 - 285
  • [44] Keep It Surprisingly Simple: A Simple First Order Graph Based Parsing Model for Joint Morphosyntactic Parsing in Sanskrit
    Krishna, Amrith
    Gupta, Ashim
    Garasangi, Deepak
    Satuluri, Pavankumar
    Goyal, Pawan
    PROCEEDINGS OF THE 2020 CONFERENCE ON EMPIRICAL METHODS IN NATURAL LANGUAGE PROCESSING (EMNLP), 2020, : 4791 - 4797
  • [45] The implementation of Lua 5.0
    Ierusalimschy, R
    de Figueiredo, LH
    Celes, W
    JOURNAL OF UNIVERSAL COMPUTER SCIENCE, 2005, 11 (07) : 1159 - 1176
  • [46] A Look at the Design of Lua
    Ierusalimschy, Roberto
    de Figueiredo, Luiz Henrique
    Celes, Waldemar
    COMMUNICATIONS OF THE ACM, 2018, 61 (11) : 114 - 123
  • [47] A materialidade das ausencias em Lua Cheia La materialidad de las ausencias en Lua Cheia The materiality of the absences in Lua Cheia
    de Almeida, Luara Teixeira
    Navas, Diana
    ELOS-REVISTA DE LITERATURA INFANTIL E XUVENIL, 2022, (09):
  • [48] Traveling light, the lua way
    Hirsch, Ashwin
    IEEE SOFTWARE, 2007, 24 (05) : 31 - 38
  • [49] Surprisingly Popular Voting Recovers Rankings, Surprisingly!
    Hosseini, Hadi
    Mandal, Debmalya
    Shah, Nisarg
    Shi, Kevin
    PROCEEDINGS OF THE THIRTIETH INTERNATIONAL JOINT CONFERENCE ON ARTIFICIAL INTELLIGENCE, IJCAI 2021, 2021, : 245 - 251
  • [50] Lupremica - Lua Scripting for Supremica
    Fabian, Martin
    Malik, Robi
    Mohajerani, Sahar
    IFAC PAPERSONLINE, 2023, 56 (02): : 6099 - 6104