Consistent perf in video games is crucial and the Lua garbage collector can be brutal in this regard. Newer versions of Lua support incremental garbage collection but it's quite realistic to dedicate 2-3 milliseconds of every frame to garbage collection. Yuck. (16ms = 60fps, 33ms = 30fps)
Lua is trivial to implement into an existing engine. Lots of iOS engines heavily rely on Lua. Large games devs don't want to become reliant on those middleware engines. It can take them many months to update to latest iOS sdk. It took several popular engines 6+ months to integrate the in-app purchase SDK update.
Havok, owned by Intel, purchased Kore and turned it into Havok Script. Havok Script is a virtual machine that runs a "Lua compatible" language. It is extremely fast. Ridiculously faster than straight Lua. It also has full debugging support and you can trivially step through a call stack that bounces between C++ and script. Havok middleware is not known for being cheap.
That said, I friggin love Lua for its flexibility and transparency. Once you grok its few basic mechanisms, everything else just falls in place. In contrast, understanding Ruby or Python is a lot more difficult since the languages themselves are a lot more complex.
In fact, if I were to teach programming, I would teach it using Lua. Implementing your own object system is increadibly instructive. Learning about coroutines and lambdas is, too. And Lua is still small enough to just read its source when in doubt. It's bytecode consists of just a few dozen instructions.
Honestly, Lua is a marvellous language and I just love to use it!
To be honest, I learned it using only the tutorial here: http://lua-users.org/wiki/LuaTutorial and google.
One thing worth knowing though: he's working on the 3rd edition (updated for Lua 5.2), though I'm not sure how soon that is expected.
The first edition is online, if you want to get an idea what it's like: http://www.lua.org/pil. In addition, the language's refrence manual is freely available online as well. Depending on how you learn, that would get you started very quickly. (It's a small language and very much follows the principle of least surprise - except for indexing arrays from 1, but you get used to that.) http://www.lua.org/docs.html has the full reference manual for 5.1 and 5.2.
Personally, I learned object orientation through this book. I knew basic OO before, but this book really explained it to me.
If these things appeal to you check out lisp (clojure is my personal recommendation)
Instead, it has seemed more like simply stepping from a clean, compact room into a large, similarly clean and smooth room but with depth you hadn't imagined before.
Well, that and learning Emacs compared to ST2 is a bit of a step at the same time.
Lisp is built around cons cells and the linked list. But it has seperate containers of various types.
Lua is built around the Lua table, which can function as a list, array, and dictionary/hash table. You can then build any other data structure from tables easily. With a metatable, you then also get read-only tables, objects and classes, and more.
Now if someone were to design a modern Lisp based around tables...
Check out clojure - advanced data structures/primitives + immutability(functional programming)
I have been mulling over better support for immutable data structures in Lua, but I haven't figured out a good and clean design yet.
I agree, it's an intriguing possibility. There was a thread about this a while ago:
To what extent does its easy C interop make up for this?
It should probably be noted that Lua gets along less well with C++, so that glue is a bit harder to write for C++ libs. There are tools that will automatically generate that glue for C++, but I'm not familiar with them.
LuaJIT2's ffi also makes it a lot quicker.
I wanted to start out using Lua as a scripting language which may not be a good fit, but it seemed more compelling than other languages I was looking into.
You can embed yourself lua, and that's it's power. It can go down to 30-40kb (without parser), and run on PS3 SPU chip (256kb memory).
It does not use any globals, all goes through a state structure, so you can have multiple runtimes (and different ones, HavokVM, lua reference, luajit) if you want at the same time.
Don't get me wrong, Corona is cool, but there is also moai, and tons of other toolkits, and hundreths of other games that are using it - for scripting, ui layout, configuration, many other things.
Computercraft, a mod for minecraft embeds lua in minecraft for you to program. Not a direct use of lua in gaming, but cute!
Many other games use it for scripting. When I worked at Sony, we were using it on quite a few PlayStation games.