1 / 15

Lua

Lua. By: Michael Coffman Peter Sussman. History. Lua means ‘moon’ in Portuguese First appeared in 1993 Created by Roberto Ierusalimschy , Luiz Henrique de Figueiredo , and Waldemar Celes at Pontifical Catholic University of Rio de Janeiro in Brazil

samson
Télécharger la présentation

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 By: Michael Coffman Peter Sussman

  2. History • Lua means ‘moon’ in Portuguese • First appeared in 1993 • Created by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, and WaldemarCeles at Pontifical Catholic University of Rio de Janeiro in Brazil • Developed because Brazil had a strong policy against foreign trade • Primary influence: c++

  3. Features • Light, multi-paradigm language • Highly portable: can be compiled to run on Linux, Windows, Macintosh • Very small: complete language occupies less than 1 megabyte • Dynamically typed; eight types, boolean, number, string, nil, function, userdata, thread, table • Also has automatic garbage collection

  4. Features • Only data structure is the table, which can be used to implement arrays, lists, etc. • Can run code in pure interpretation or intermediate byte code (such as Java) • Can call functions written in C or Lua • Arrays do not have to be only one type • Variables are global unless otherwise declared

  5. Code Samples

  6. Code Samples

  7. Code Samples

  8. Sample Runs

  9. Sample Runs

  10. Readability • Pros • Functions are well defined and easy to follow • Similar to C syntax • Very little parentheses or brackets • Cons • Most blocks of code end in ‘end’ • No spaces between terminals and nonterminals • Variables don’t have declared types, only their values do

  11. Writability • Pros • Few keywords • All blocks of code end with ‘end’ • Syntax similar to C • Cons • All blocks of code end with ‘end’ • Limited data types

  12. Reliability • Pros • One of the most reliable languages on the market • Cons • Easy to get lost in the nested ‘end’ statements leading to programming errors

  13. Cost • Pros • Free • Small and portable: Lua can be used from a USB drive from one machine to the next, and across multiple OS’s • Cons • Lua is not considered a mainstream language, so training might cost a fair amount

  14. Who Uses Lua • Blizzard Entertainment: World of Warcraft scripting • Cisco Systems • Maxis/EA: SimCity 4 • Adobe: Adobe Photoshop Lightroom • Many video games use Lua

  15. References • http://www.lua.org/ • http://en.wikipedia.org/wiki/Lua_(programming_language)

More Related