6 ms·
I'm frustrated by Lua, because it seems such a productive, pragmatic language that is performant to boot (let alone the numbers LuaJIT is posting), but yet it n
by jasonwatkinspdx 16y ago
I'm frustrated by Lua, because it seems such a productive, pragmatic language that is performant to boot (let alone the numbers LuaJIT is posting), but yet it never seems to gain momentum.
Why has Lua adoption been so slow outside the game world?
- ay 16y agoI think those who find it a productive tool, just use it without waiting for the whole herd to head that direction - and since it's just a tool that provides a productivity edge - why advertise too much about it on blogs ;-) http://www.cisco.com/en/US/docs/security/csd/csd35/configuration/guide/CSDdaps.html#wp1057235 http://www.cisco.com/en/US/docs/security/csd/csd35/configura... (disclaimer: cisco is my employer). (disclaimer#2: I did use lua for quick prototypes that involved the low-level C code and higher level logic to glue it. So the positive feelings I got from it may be biasing me).
- kristopher 16y agoI think this mostly has to do with the 'Batteries -not- included' approach of Lua. This is mainly done to keep the language/vm compact and embeddable, yet what it leads to is many similar implementations of modules that do not play well together.
- manveru 16y agoI read a related article a while back: http://journal.dedasys.com/2010/03/30/where-tcl-and-tk-went-wrong http://journal.dedasys.com/2010/03/30/where-tcl-and-tk-went-... It's interesting to draw parallels to Lua, they both started out as embedded scripting languages with a small core.
- davidw 16y agoGreat article:-) I think managing the addition of batteries is definitely tricky for a language like Lua. Some of its users do not want any additional baggage: they want small, fast and easy to embed. Other people may want to use it as a 'scripting language', and thus want to have a bunch of libraries and additional goodies to get stuff done with.
- extension 16y agoThis. Lua doesn't even have a standard class/inheritance model. If you want that, you implement it in-language. There are some nice general purpose ones out there, but nothing canonical. If someone makes a killer web framework on top of one of these models, that might establish the standard and bootstrap the Lua scene, kind of like how Rails established a lot of idioms for Ruby.
- draegtun 16y agore: makes a killer web framework There have been two Ruby web framework ported to Lua: * Orbit (http://orbit.luaforge.net/ http://orbit.luaforge.net/) - Camping port * Mercury (http://github.com/nrk/mercury http://github.com/nrk/mercury) - Sinatra port
- silentbicycle 16y agoThere's also Kepler (http://www.keplerproject.org/ http://www.keplerproject.org/), which I haven't used, and WSAPI (http://keplerproject.github.com/wsapi/ http://keplerproject.github.com/wsapi/), which is roughly like Rack or WSGI. It's not a "web framework", but using WSAPI with FastCGI works well for CGI-ish stuff.
- meric 16y agoAgreed. This is the first time I've seen someone mention lua on a non-lua based community site. :(
- draegtun 16y agoThere have been quite a few sightings of Lua here on HN: http://www.google.com/search?q=site:news.ycombinator.com+lua http://www.google.com/search?q=site:news.ycombinator.com+lua
- silentbicycle 16y agoLua is gaining momentum, but it's been a very slow burner. There are a lot of programs (mostly games) that use it, and they aren't required to be open about it. Lua also improved quite a bit (IMHO) between 4.0 and 5.1, but 5.1 has only been out since 2006. Some things omitted from Lua's std libs because you'd typically just do them in C anyway, and it keeps Lua very small. While you don't need to know C to use Lua (and there are community libraries for them, see LuaRocks: http://luarocks.org/repositories/rocks/ http://luarocks.org/repositories/rocks/), it really shines in symbiosis with C. Most web devs don't know C, though, so it misses quite a bit of the free hype that would come from word of mouth in that community (look at e.g. Ruby), especially compared to word of mouth in the (NDA-infested) gaming industry. FWIW, I don't think it would take long for somebody proficient in Javascript (or Python) to learn Lua - This comment (http://news.ycombinator.com/item?id=1786280 http://news.ycombinator.com/item?id=1786280) is a good summary. The languages are very similar in overall design (prototypes, JSON/dict-style objects, etc.), but where Javascript has numerous design bugs frozen in its spec (thanks to the browser wars) and "The Good Parts" telling how to sidestepping them, Lua had 15 extra years to evolve and fixed them. Recommended intro: Ieursalimschy's _Programming in Lua, 2nd ed._ (http://www.inf.puc-rio.br/~roberto/pil2/ http://www.inf.puc-rio.br/~roberto/pil2/). The first edition is free online, but covers 4.0, and the language changed a lot (most notably, the packaging system).
- silentbicycle 16y agoAlso, besides LuaRocks, some more libraries are listed on the Lua wiki: http://lua-users.org/wiki/LibrariesAndBindings http://lua-users.org/wiki/LibrariesAndBindings
- pygy_ 16y agoNitpick: The first edition of the PiL Book covers Lua 5.0 which is very similar to 5.1. The most noticeable changes are the vararg handling, the module system (as you said, but it will be phased out in v5.2), and some library changes. The differences are listed here: http://www.lua.org/manual/5.1/manual.html#7 http://www.lua.org/manual/5.1/manual.html#7 That said, I purchased the second edition to understand the module system, only to decide not to use it anyway :-). I don't like the way the `module` function pollutes the global namespace.
- jrockway 16y agoWhy has Lua adoption been so slow outside the game world? No libraries.
- silentbicycle 16y agoWell, there are plenty at LuaRocks (http://luarocks.org/repositories/rocks/ http://luarocks.org/repositories/rocks/). It's no CPAN, but the essentials are there. I'm working on a couple, such as Tamale (http://github.com/silentbicycle/tamale/ http://github.com/silentbicycle/tamale/), which adds Erlang-style pattern matching. I'll post it on LuaRocks once the docs are done. Of course, if you're embedding Lua (in a game, for example) you've already got the libraries you need, and extra libraries would just get in the way.