3 ms·
Lua makes for an ideal language to embed in a larger project. Structurally, it's like python, but it's smaller and more internally consistent (without the large
by enkiv2 12y ago
Lua makes for an ideal language to embed in a larger project. Structurally, it's like python, but it's smaller and more internally consistent (without the large standard library), faster, and has a nicer C API.
Because Lua is an academic project, it has different pressures than a primarily practical project like python or perl. The Lua source code fits on a floppy disk, is pure C, and is clear and well-written.
As for what's (arguably) bad about Lua:
1) it doesn't have nearly as large a community as other similar languages, and what community it does have is in many cases split up between software packages that use it as an extension language or a configuration language. The config files for awesome and for ion are written in Lua, but that doesn't mean you can take the configuration for one and port it to the other. Likewise, WoW and photoshop both make use of Lua for scripting. I get the impression that a lot of people who use Lua don't realize that it's a general purpose language and an independent project.
2) It lacks a strong standard library, and many really common things (like sockets) aren't built in. Until version 5.1, importing installed packages wasn't even a completely standard part of the language. More complicated packages often exist but are fairly obscure, and there's no gem/npm/pip style system for pulling packages down automatically or managing their dependencies.
3) There are some odd limitations here and there. In 2007 I was working on a project in Lua that took advantage of a single very large table -- and learned that there was at that time a limit of 2^13 string keys. I think that limit has since grown, but it's unusual for a scripting language to have such a low limit for anything (aside from recursion depth).
- mtmail 12y ago"The Lua source code fits on a floppy disk" That's a comparison I haven't heard in a long time. On my system Lua (including /bin, /lib, /include, /share) is 300k.
- stevekemp 12y agoThe fourth complaint is that it is developed largely without any public discussion - new releases land, and suddenly there are API changes you must include. I've written a mail-client which is both configured and scripted with Lua. For ease of embedding it works really really well, and coding it was a pleasure. But I'm still disappointed when I have to update for new Lua releases (e.g. 5.1 -> 5.2 required some changes I wasn't expecting.)