From WikiChip
Lua

Lua (pronounced LOO-ah[1]) is a light-weight, functional, garbage collected, dynamically-typed programming language designed to work as an extension or as an embedded scripting language. Lua is generally considered a very fast, very simple, and very small (program size) making it highly embeddable and portable. The official Lua implementation is portable and open-source, released under the MIT License. Lua only has one data structuring mechanism called tables.

History

Lua was created at PUC-Rio, the Pontifical Catholic University of Rio de Janeiro in Brazil in 1993 by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, and Waldemar Celes[2]. In 1993, Lua 1.0 was created as the first working implementation that worked. The implementation used yacc and lex using a stack-based virtual machine[3]. Much of the control structures syntax is borrowed from Modula.

The first public release of Lua was announced on Fri, 8 Jul 1994 in various usenet newsgroups. Lua sought internal exposure using various publications such as in the Dec 1996 issue Dr. Dobb's Journal.

luac

luac is Lua compiler that can translate Lua source code into binary files that can be later loaded and executed. This makes it possible for a program to not need to compile the source at run-time. This ability also allows for faster program loading but not necessarily smaller lua programs.[4]

Versions

Version Release Date Description
1.0 1993 First working implementation
1.1 1994 Reference manual created, documentation established
2.1 1995 An value can be used as an index.
Broke backwards compatibility
Improved constructor semantics.
2.4 1996 The luac external compiler was created which compiled source code into bytecode and string tables packed in a portable binary format. This removed the need of programs to compile the source during run-time.
3.1 1998 Introduced closures and anonymous functions into the language.
3.2 1999 Multithreading support through no shared memory and multiple independent states.
4.0 2000 Added for loop, new set of API
4.1 2001 Coroutines added, portable implementation, deterministic semantics
5.0 2003 Register-based virtual machine. Tables were reimplemented.
5.1 2006 Incremental garbage collector was added. Better module support.
5.2 2011 Ephemeron tables implementation. Bitlib library added. Tables Finalizers

Standard Libraries

Main article: Lua Standard Libraries


Lua comes with a small set of standard libraries which can be used to perform frequent tasks. The libraries are mainly an interface to the underlining C API.

References