Where to start?
The official lua.org FAQ is here, which is the place to go for essential information like Lua availability and licensing issues.
There is also an incomplete Lua Wiki FAQ; this unofficial FAQ aims to fill in the holes and answer as many questions as possible, in a useful way.
Lua is a modern dynamic language with conventional syntax:
function sqr(x)
return x*x end local t = {}
for i = 1,10 do
t[i] = sqr(i)
if i == 10 then
print('finished '..i)
end end
Although at first glance it looks like Basic, Lua is more akin to JavaScript; such as no explicit class mechanism and equivalence of a['x']
with a.x
. There are very few types; string, number, table, function, thread and userdata. This simplicity accounts for a lot of Lua's speed and compactness compared with languages of equivalent power.
The Lua User's Wiki is full of useful example source and thoughtful discussion. In particular, here is a good place to start learning Lua.
The definitive book is Programming in Lua by Roberto Ierusalimschy, who is one of the creators of Lua. (the first edition is available online)
If you are coming to Lua from another programming language, then see the list of common gotchas.
And (of course), read the manual, although this is probably not a good place to start.