1 / 16

Lua

Lua. Spencer Pruden Orlando Pile. Background Histroy. 1993 By programmers Roberto Lerusalimschy , Luiz Henrique de Figueiredo , and Waldemar Cales Members of Computer Graphics Technology Group (shortened Tecgraf) at Pontifical Catholic University of Rio de Janeiro. Goals.

moesha
Download Presentation

Lua

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lua Spencer Pruden Orlando Pile

  2. Background Histroy • 1993 • By programmers Roberto Lerusalimschy, Luiz Henrique de Figueiredo, and WaldemarCales • Members of Computer Graphics Technology Group (shortened Tecgraf) at Pontifical Catholic University of Rio de Janeiro

  3. Goals • offer a new language that featured • Extensibility • Simplicity • Efficiency • Portability

  4. Features • Can Interface with C/C++, other languages, such as FORTRAN, Java, Smalltalk, Ada, and other scripting languages • Simple and small language • one of the fastest languages in the realm of scripting (interpreted) languages • highly portable multi-platform language

  5. Compatible with • Windows • UNIX • Shares same source code with • NextStep, OS/2 • PlayStation II (Sony) • Mac OS-9 and OS X • BeOS, • MS-DOS, • IBM mainframes • EPOC, • PalmOS, • MCF5206eLITE • Evaluation Board, • RISC OS

  6. Data Types • Lua 5.0 • -Threads • -Booleans • earlier versions • Number • String • Table • Function • user data • nil

  7. Similarities with Other Languages • Scheme • semantic structure • first-class functions with lexical scoping • Modula programming language • -use of familiar words • C • -create functions during run-time without compilation and functions also have no declaration

  8. Recursive: function factorial (n) if n == 0 then return 1 else return n*factorial (n-1) end end Iterative: function factorial(n) local a = 1 for i = 1, n do a = a*i end return a end Similarity that the syntax of Lua has with other programming languages demo

  9. Tables • associative arrays which can store arbitrary pairs of values • replace special data structures inside the core with ordinary Lua tables • Lua 4.0 for representing the global environment (which keeps all global variables) • Lua 5.0 for implementing extensible semantics

  10. More on Tables • The tables created can be in the form of lists or arrays which when used with the constructor {}

  11. Strings • Lua 1.1methods for declaring a string • single quotes • double quotes Lua 2.2 ability to use long strings

  12. Control Structures • If begins conditional • while • repeat • for • Terminator = end

  13. Control Structures continued • conditional expression of a control structure can be any value • the values are always true • if they are not already false and “nil”.

  14. Popularity • Where • video game industry • Reasons • small, efficient, and portable • extensive use of scripting languages • the game logic, • trigger events • ability to speed up development time

  15. Conclusion • small package of Lua which allows it to be used for applications in which space constraints are a major factor • the portability of Lua which allows it to be compatible with a large variety of platforms • a highly efficient scripting language which does not consume a large amount of system resources

  16. Sources • Bolton, David, “Lua – a Scripting Language for Games,” About.com, December 23, 2008, accessed April 20, 2012. • http://cplus.about.com/b/2008/12/23/lua-a-scripting-language-for-games.htm • Gao, Lee, “The.Lua.Tutorial, The Crash Course.” • http://luatut.com/crash_course.html, accessed April 29, 2012. • Lerusalimschy, Roberto, Programming in Lua, Lua.org, 2003 • Lerusalimschy, Roberto, Figueiredo, L. H, Celes, W. “The Evolution of Lua”, History of Programming Languages Conferences (HOPL), 2007.

More Related