3 ms·
Some things I love about Lua: 1) Lua takes a page from the Scheme book in that the authors try to give a very minimal yet very extensible core -- they don't gi
by groovy2shoes 15y ago
Some things I love about Lua:
1) Lua takes a page from the Scheme book in that the authors try to give a very minimal yet very extensible core -- they don't give you tons of features, but they try to give you the baseline constructs you need to build other features. It's easy, as it is in Scheme, to do procedural, object-oriented, and functional programming in Lua (and even mix them).
2) Lua syntax can be pretty (although I've found that it doesn't lend itself well to embedded DSLs).
3) Lua is distributed as a very small library with an intuitive (at least for me, YMMV) C API, which makes it trivial to embed.
4) The Lua VM is more performant than Python, Ruby, Perl, PHP, and Tcl (although you get far fewer libraries; no batteries included). There's also the LuaJIT implementation, which is the fastest dynamic language implementation I know of (and it's fully compatible with the stock C API).
5) Lua is straightforward to learn (at least as straightforward as Python or QBasic), yet has a lot to offer the more knowledgeable programmer.
6) The documentation is detailed, specific, and concise.
All of these points make Lua an excellent language for embedding into applications (which is what it was originally designed for), but it's not often an excellent choice for general-purpose programming or even general-purpose scripting. Point 1 is a double-edged sword, just like it is in Scheme: you often end up with many different object systems, module systems, etc. in different codebases which can be painful for interop. I hear that this is also a painpoint for Tcl.