Difference between revisions of "Lua"

From Mario Fan Games Galaxy Wiki
(Cleaning / clarifying)
Line 1: Line 1:
 
{{Lua}}
 
{{Lua}}
'''Lua''' is a scripting language that is designed for embedding. As a result, it was designed based on an entirely different set of principles than most languages; it is quite minimalist, not providing as many features of higher-level languages. However, most of these features can be implemented or emulated relatively easily due to powerful [[Lua: Metamethods|features]]. In addition, Lua supports external C libraries to provide extra functionality, and a special <tt>[[Lua: Userdata|userdata]]</tt> type that can be manipulated both in C and Lua.
+
'''Lua''', named after the Portuguese for the moon, is an extremely rapid and modular scripting language based heavily on [[Scheme]] and designed to be embedded into software development environments. It has full support for anonymous [[function]]s, [[Lua: Coroutines|coroutines]] and first-class functions. There are several [[extension]]s for [[Multimedia Fusion 2]] that allow integration of Lua, such as [[Retriever II]]'s [[XLua]].
  
Lua is extremely fast, almost always one of if not the fastest scripting languages for a given task, and can be easily ported to almost any platform or hardware with the few hundred KB of storage space required for the implementation. For these reasons it sees wide use in game programming. [[MMF2]] has three Lua extensions, though XLua is the only one actively developed and the most stable.
+
Lua's primary data structure is the [[Lua: Tables|table]], and includes various data formats. It is generally used whenever custom data objects are created, and as such is extremely common in any advanced Lua code.
  
Lua is built off of a single complex data structure, the [[Lua: Tables|table]], which efficiently incorporates both hash table and array sections. Most custom data objects will in fact be tables, often with their own set of methods and functions.
+
Lua itself is minimalist and does not directly feature many of the powers inherent in languages such as C, but these features may be implemented or emulated through the use of [[Lua: Metamethods|metamethod]]s.
  
Lua borrows much of its feature set from [[Scheme]]; in fact, few other parts of the design stemmed from other languages. It has full support for anonymous [[function]]s, [[Lua: Coroutines|coroutines]] and first-class functions, which often go missing in other languages. Its roots as a data-description language also allow for convenient [[syntactic sugar]] in some cases.
+
Lua supports C libraries (ie. *.dll files) when properly compiled to provide further functionality, as well as the <tt>[[Lua: Userdata|userdata]]</tt> type, which may be manipulated both in C and Lua.
  
The current version is {{Lua Version|nominor=}}, or more specifically {{Lua Version}}, with version 5.2 in progress.
+
Lua is currently in version {{Lua Version}}.
  
MFGG projects that may use Lua:
+
'' ''
*[[Pocket Mario]] (?)
+
== See also ==
*[[Super Daisy: Legend of the Ztar Rod]] (?)
+
* Various MFGG community projects utilizing Lua:
*[[MPUZ]]
+
**[[Pocket Mario]], a [[fangame]] developed by [[Klobber]] and [[Retriever II]]
*[[COSINE]]
+
**[[MPUZ]], a [[fangame]] developed by [[Xgoff]]
*[[Tile Lattice]]
+
**[[COSINE]], a [[Multimedia Fusion 2]] multi-purpose game engine by [[Xgoff]]
*[[MechaSource]] and its games
+
**[[Tile Lattice]], a [[Multimedia Fusion 2]] level editor by [[Retriever II]]
 +
**Games by [[MechaSource]]
  
 +
'' ''
 
== External Links ==
 
== External Links ==
*[http://en.wikipedia.org/wiki/Lua_(programming_language) Wikipedia Article]
+
*[http://en.wikipedia.org/wiki/Lua_(programming_language) Wikipedia's article]
 
*[http://www.lua.org/manual/5.1/manual.html#2 Official Manual]
 
*[http://www.lua.org/manual/5.1/manual.html#2 Official Manual]
*[http://www.lua.org/demo.html Online version of Lua5.1.exe]
+
*[http://www.lua.org/demo.html Online demo of Lua5.1.exe]
*[http://www.lua-users.org Lots of information, tutorials, and sample code]
+
*[http://www.lua-users.org Various tutorials, information, sample code]
 
[[Category:Languages]]
 
[[Category:Languages]]

Revision as of 00:56, 6 October 2009

Lua
Lua.gif
Basics
Intermediate
Advanced
XLua
Add to this template
 Standardwikimessagebox.png This article assumes the use of Lua 5.1.

Information may not be accurate or may need revision if you are using a different version.

Lua, named after the Portuguese for the moon, is an extremely rapid and modular scripting language based heavily on Scheme and designed to be embedded into software development environments. It has full support for anonymous functions, coroutines and first-class functions. There are several extensions for Multimedia Fusion 2 that allow integration of Lua, such as Retriever II's XLua.

Lua's primary data structure is the table, and includes various data formats. It is generally used whenever custom data objects are created, and as such is extremely common in any advanced Lua code.

Lua itself is minimalist and does not directly feature many of the powers inherent in languages such as C, but these features may be implemented or emulated through the use of metamethods.

Lua supports C libraries (ie. *.dll files) when properly compiled to provide further functionality, as well as the userdata type, which may be manipulated both in C and Lua.

Lua is currently in version 5.1.4.

See also

External Links