5 ms·
experimenting with lua this evening. be curious to hear if others have had good/bad experiences with it.
by trevelyan 18y ago
experimenting with lua this evening. be curious to hear if others have had good/bad experiences with it.
- antiform 18y agoPlaying with Lua is a blast. I don't have much experience in using it for anything but a third-order language (e.g. writing programs that write programs), but it's very lightweight, fast, and easy to pick up. I view it as a language that I use when I need the power of a programming language (as opposed to a one-off program), but not enough to justify using Perl/Python/Ruby. There are some parts that I did find annoying, however, like the fact that in the standard libraries array indexing starts at 1 instead of 0 and that it gets a bit kludgy when you try and add lots of things that are not part of standard language features, but nothing you can't overcome.
- jd 18y agoIt's great as an embedded language. The implementation is so tiny you can effortlessly change the language to change whatever it is you don't like about it. The C++ bindings aren't so great, last time I checked. The documentation is not of a consistently high quality, but it doesn't matter much because, once again, the language isn't very complex. I prefer lua to any other embeddable language, including Python.
- deleted 18y ago[deleted]
- silentbicycle 18y agoIt's one of my favorite languages, and is rapidly crowding out Python. It's a tremendously clean and powerful language. Since Lua was designed for embedding, its design favored adding a few meta-features that could be used to build task-appropriate features into the language, rather than adding to the language core. It's also a relatively quick language to learn, and is extraordinarily portable - the whole language is written in pure ANSI C. It also has tail-call optimization, closures, coroutines, and other aspects that are interesting from a pure CS standpoint, such as the way the table datatype is implemented and its register-based VM. For a good taste of Lua, skim "The Implementation of Lua 5.0" (http://www.tecgraf.puc-rio.br/~lhf/ftp/doc/jucs05.pdf http://www.tecgraf.puc-rio.br/~lhf/ftp/doc/jucs05.pdf), the quick intro to Lua in the LPEG paper (http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html , around page 6 of the PDF), or _Programming in Lua_ (http://www.inf.puc-rio.br/~roberto/pil2/ http://www.inf.puc-rio.br/~roberto/pil2/). The first edition of the latter is online, though the second edition has a bunch of added material, and IMHO is well-worth buying if you get into Lua. Also, check out LuaJIT (http://luajit.org/ http://luajit.org/), if you're using i386 hardware -- it's a FAST JIT.