Preview

Macro

Good Essays
Open Document
Open Document
5801 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Macro
The Lua Architecture
Advanced Topics in Software Engineering

Mark Stroetzel Glasberg Jim Bresler Yongmin 'Kevin ' Cho

Introduction
Lua is a powerful light-weight programming language designed to extend applications. Lua started as a small language with modest goals. The language has grown incrementally. As a result, Lua has been re-architected and rewritten several times in the past ten years. The original functional requirements and motivation of the architecture were documented in the paper “Lua-an extensible extension language” [1]. A few other versions of the language were briefly described in “The Evolution of an Extension Language: A History of Lua” [3]. The architecture and implementation was created and is maintained by Roberto Ierusalimschy, Waldemar Celes and Luiz Henrique de Figueiredo at the Computer Graphics Technology Group of the Pontifical Catholic University of Rio de Janeiro in Brazil (PUC-Rio). Lua’s implementation consists of a small library of ANSI C functions that compiles unmodified in all known platforms. The implementation goals are simplicity, efficiency, portability, and the ability to run on small devices with limited capabilities. These implementation goals resulted is a fast language engine with small footprint, making it ideal in embedded systems. This paper reconstructs and documents the architecture of Lua version 5.0.2. Lua 5.0.2 contains approximately 25,000 lines of source code. The code base uses an instance of the compiler reference model, has several identifiable patterns, and is divided into clearly defined modules such as the code interpreter, parser and virtual machine. The language is being used in several projects at Tecgraf, PUC-Rio, University of Illinois at Urbana-Champaign and in several industry companies such as Microsoft, LucasArts Entertainment, and others.

Architectural Requirements
Lua’s main quality attributes, which are simplicity, performance, flexibility, and portability, were driven by the



References: [1] [2] R. Ierusalimschy, L. H. de Figueiredo, W. Celes, “Lua-An Extensible Extension Language”, Software: Practice & Experience 26 pp 635-652 #6 (1996). L. H. de Figueiredo, R. Ierusalimschy, W. Celes, “The Design and Implementation of a Language for extending applications”, Proceedings of XXI Brazilian Seminar on Software and Hardware, pp 273-283 (1994). R. Ierusalimschy, L. H. de Figueiredo, W. Celes, “The Evolution of an Extension Language: A History Of Lua”, Proceedings of V Brazilian Symposium on Programming Languages B-14--B-28 (2001). L. H. de Figueiredo, R. Ierusalimschy, W. Celes, “Lua: An Extensible Embedded Language a Few Metamechanisms Replace a Host of Features”, Dr. Dobb 's Journal 21 #12 pp 26-33. [DDJ] (Dec 1996) J. Gracia-Martin, M. Sutil-Martin, “The Extreme Compiling Pattern Language” Associative Array at Wikipedia, “http://en.wikipedia.org/wiki/Associative_array” R. Ierusalimschy, L. H. de Figueiredo, W. Celes, “Lua 5.0 Reference Manual”, Technical Report MCC-14/03, PUC-Rio, 2003 L. H. de Figueiredo, R. Ierusalimschy, W. Celes, “The Design And Implementation Of A Language For Extending Applications”, Proceedings of XXI Brazilian Seminar on Software and Hardware pp 273-283 (1994). Len Bass, Paul Clements, and Rick Kazman; “Software Architecture in Practice”, second edition, Apr 9, 2003, Addison-Wesley Frank Buschmann, Regine Meunier, Hans Rohnert, Peter Sommerlad, and Michael Stahl; “Pattern-Oriented Software Architecture: A System of Patterns” 1996, Wiley & Sons Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides; “Design Patterns” 1994, Addison-Wesley “The Kepler Project” at http://www.keplerproject.org, 2004, Fábrica Digital and PUC-Rio “tolua” at http://www.tecgraf.puc-rio.br/~celes/tolua/ , 2004, Tecgraf/PUC-Rio “IUP” http://www.tecgraf.org/iup, 2004, Tecgraf/PUC-Rio “LuaSocket” at http://www.tecgraf.org/luasocket, 2004, Fábrica Digital and PUCRio 17 [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] “Luaorb” at http://www.tecgraf.puc-rio.br/luaorb , 2004, Tecgraf/PUC-Rio John R. Levine, Tony Mason, Doug Brown; “Lex & Yacc” 1992, O 'Reilly & Associates David Jeske, “A Fast Multiple-Inheritance Tag Method Implementation in Lua”, at http://www.lua.org/notes/ltn008.html Lua Technical Note 8. Ana Lúcia de Moura, Noemi Rodriguez, and Roberto Ierusalimschy; “Coroutines in Lua” July 2004 Journal of Universal Computer Science, pp 910-925 10(7). Kein-Hong Man. “A No-Frills Introduction to Lua 5 VM Instructions”, November 28th, 2004 Richard P. Brent; “Reducing the retrieval time of scatter storage techniques” 18

You May Also Find These Documents Helpful

  • Good Essays

    In a procedural program, modules interact by reading and writing state that is stored in shared data structures.…

    • 793 Words
    • 4 Pages
    Good Essays
  • Good Essays

    Comp 220

    • 1463 Words
    • 6 Pages

    This lab will explore the use of pointers in several ways. Pointers will be used to dynamically allocate memory for new class objects on demand from the user, and they will be used to access class-member functions. Pointer arithmetic will be used to access and sort class objects according to criteria explained in the lab.…

    • 1463 Words
    • 6 Pages
    Good Essays
  • Satisfactory Essays

    Prg420 Syllabus

    • 1691 Words
    • 7 Pages

    Yelick, K., Hilfinger, P., Graham, S., Bonachea, D., Su, J., Kamil, A., et al. (2007, fall). Parallel languages and compilers: Perspective from the Titanium experience. International Journal of High Performance Computing Applications, 21(3), 266.…

    • 1691 Words
    • 7 Pages
    Satisfactory Essays
  • Powerful Essays

    Macro

    • 1824 Words
    • 8 Pages

    PRICE 6. THE MARKETMARKETIS THE PRICE AT WHICH THE CLEARS ITSELF OF BOTH THE SURPLUSES AND SHORTAGES. True False What kind of good is x if price of good y drops then demand for good x…

    • 1824 Words
    • 8 Pages
    Powerful Essays
  • Powerful Essays

    Macro

    • 2712 Words
    • 11 Pages

    To state that public saving is equal to investment, for a closed economy, is to state an accounting identity.…

    • 2712 Words
    • 11 Pages
    Powerful Essays
  • Powerful Essays

    D.3.3 [Programming Languages]: Language Contructs and Features – abstract data types, polymorphism, control structures. This is just an example, please use the correct category and subject descriptors for your submission. The ACM Computing Classification Scheme: http://www.acm.org/class/1998/…

    • 5662 Words
    • 23 Pages
    Powerful Essays
  • Good Essays

    This paper will discuss the difference between procedural modules and object-oriented methods. How both methods work and some of the pro cons between the two methods.…

    • 926 Words
    • 4 Pages
    Good Essays
  • Good Essays

    Macro

    • 482 Words
    • 2 Pages

    The four phases of a business cycle are trough, recovery, peak, and recession. The length of an average business cycle can be anywhere from 2-15 years. Capital goods and durable goods last, and therefor purchases can be postponed. This may happen when a recession is predicted to be lurking. Durable goods industries therefor suffer large output declines during recessions. However, consumers cannot postpone the buying of nondurables; therefore recessions only slightly reduce non-durable output.…

    • 482 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    Macro 1

    • 815 Words
    • 4 Pages

    factors other than disposable income that affect consumption. So when consumers feel optimistic about their future, they will generally spend more and save less at any given level of disposable income. Reversely if consumers feel pessimistic about their future then the opposite will occur, where they will spend less and save more at all level of disposable income. An example of where the exogenous consumption would increase would be in times of economic boom, where share prices rise and property prices increase. Consumers would feel wealthier and hence tend to spend more rather than save, therefore increasing exogenous consumption. In times of economic recession however, consumers would feel poorer and uncertain, so they would save more and spend less hence driving exogenous consumption down.…

    • 815 Words
    • 4 Pages
    Powerful Essays
  • Powerful Essays

    The following information will introduce general knowledge in basic programming concepts. It shall discuss basic types of computer programming languages as-well-as program development. There are three basic types of computer programming languages that will be discussed in a simple and easy to understand manner. We shall also describe the program development cycle and discuss why it is important to use a structured and organized process to create a computer programming language.…

    • 1318 Words
    • 6 Pages
    Powerful Essays
  • Powerful Essays

    Chapter 13: Using Disk Data Files ............................................................. 329 Chapter 14: Using Databases .................................................................... 395 Chapter 15: Inheritance and Polymorphism ................................................ 443 Appendix A: Exercise Solutions…

    • 109499 Words
    • 438 Pages
    Powerful Essays
  • Powerful Essays

    The company started out in 1958 as a joint venture with New Zealand Dairy Board. Under this venture, New Zealand Creamery would provide all the local support needed while New Zealand Dairy Board would provide all the technology needed to produce dairy products. Unfortunately, the management teams were not able to agree on all of the terms of the agreement, so the project never materialized. In 1960, the company once again entered into a joint venture with Golden State California which is a part of the Foremost Dairy group of the United States. Hence, the company was now named Golden State Philippines. Under this agreement, Golden State of California was to provide the production and purchasing aspect and Golden State Philippines would provide the marketing and physical Distribution of finished goods. However, due to technical difficulties, Golden State Philippines had to cancel its contract with Golden State California. It was at this point that the founder decided to pursue the existing business by sending his manager t undergo training in Australia and New Zealand in order to gain the technical and production know how. After gaining the valuable education, the company was now ready to go back into business on its own. But with the contract of Golden State Canceled, it had to acquire a company name in order to resume operations in the soonest possible time, and since an application for a business name in the SEC took a long time to process, to owner of the company decided to reactivate the name New Zealand Creamery, in 1962, and ever since then, the company…

    • 1875 Words
    • 8 Pages
    Powerful Essays
  • Powerful Essays

    about dom in xml

    • 2907 Words
    • 12 Pages

    The W3C provides a standard recommendation for building a tree structure in memory for XML…

    • 2907 Words
    • 12 Pages
    Powerful Essays
  • Powerful Essays

    Preface Introduction Chapter 1: What is a Pointer? Chapter 2: Pointer Types and Arrays. Chapter 3: Pointers and Strings Chapter 4: More on Strings Chapter 5: Pointers and Structures Chapter 6: More on Strings and Arrays of Strings Chapter 7: More on Multi-Dimensional Arrays Chapter 8: Pointers to Arrays Chapter 9: Pointers and Dynamic Allocation of Memory Chapter 10: Pointers to Functions…

    • 9878 Words
    • 40 Pages
    Powerful Essays
  • Good Essays

    While early PC owners usually had to write their own programs to do anything useful with machine, today’s users have access to a wide range of commercial and non -commercial software, which is provided in ready –to- run or ready - to- compile form.…

    • 939 Words
    • 4 Pages
    Good Essays