Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
The Evolution of Lua (tecgraf.puc-rio.br)
28 points by silentbicycle on May 19, 2009 | hide | past | favorite | 11 comments


Nice point. Two months ago i was choosing between ruby, python and lua for a network project. I made a lot of research onto python and ruby, but did not find anything about lua. It should help me alot. As soon as i finish read, i will post my conclusions, now that i´m playing with ruby for two months.


If you want to learn Lua, _Programming in Lua_ (http://www.inf.puc-rio.br/~roberto/pil2/) is the best book, by far.

The first edition is free online, though there are some changes between Lua 5.0 and 5.1 (most notably: the module system and the syntax for variable-argument functions), so if you get into the language, it's worth buying PiL2.

In my experience, Lua is most similar to Python, but with a cleaner overall design, and a more pronounced Scheme influence (real lambdas, coroutines, lexical scoping, etc.). It's a "smaller" language, in much the same way that Scheme is smaller than Common Lisp. OTOH, they've made it very easy to use with C (both calling C libraries and as a scripting layer for C), so having a smaller standard library is not a big deal. It's also trivially portable. (It's supposed to be easily usable with C++, but I haven't tried.)


Lua Programming Gems was released around christmas and I think it's pretty good (although you definitely want PiL first). The mailing list is very friendly and there's plenty of information available on the lua-users.org wiki. Also take a look at Penlight (http://penlight.luaforge.net/), which tries to add a collection of useful helper functions to Lua. I haven't explored it in detail yet, but it looks like the strongest attempt so far. Finally, The Implementation of Lua 5.0 (http://www.tecgraf.puc-rio.br/~lhf/ftp/doc/jucs05.pdf) is well-worth reading. It has some interesting discussion about the move from a stack-based (pre-5.0) to a register-based virtual machine.


PIL is definitely the book for experienced programmers. "Beginning Lua Programming" from Wrox is also worth looking into you're relatively new to programming, it maintains a more informal style than PIL and covers most of the core things you'll want to do with Lua.


Aside from their traditionally different uses, Lua is most similar to Javascript.


I don't think their uses are that different, though. They were both designed to be flexible extension languages for programs written in a different language, and were strongly influenced by Scheme.

In particular, Javascript's JSON seems semantically identical to Lua's table notation (just with different braces in different places). Lua is used as a data serialization language as well (see the notes about Petrobras, for example), and the compiler has been tuned specifically for vacuuming up data files. It's also good as a ready-made config file format.


I've been meaning to look into Lua since Tokyo Cabinet is scriptable with it. Thanks!


It has API wrappers for a lot of other database systems, as well.

See: http://lua-users.org/wiki/LibrariesAndBindings, luaforge (http://luaforge.net/), and LuaRocks (http://luaforge.net/).


Oddly, the link 403s for me.



Oh, thanks!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: