7 ms·
I have trouble finding a use for Lua, even though I like it better as a language than most. The problem is that it isn't a good "starting place" for an app. In
by chipsy 17y ago
I have trouble finding a use for Lua, even though I like it better as a language than most.
The problem is that it isn't a good "starting place" for an app. Instead you write something in C/C++ and say "oh, I wish I had a dynamic language for this part" and then you add Lua on top. And this is part of why Lua is such a compelling language now - by being extension-focused it's been able to iterate the entire language many times over and make basic semantic changes without worrying about backwards-compatibility.
But if I start writing an app and want something Lua-like....it ends up being easier to start in Python. There are some good projects out there to address this but it's a question of maturity - as of right now Lua still doesn't really satisfy as a "batteries-included" platform.
- silentbicycle 17y ago> by being extension-focused it's been able to iterate the entire language many times over and make basic semantic changes without worrying about backwards-compatibility. This is a very good point - Lua seems to have improved quite a bit since (say) 4.0 - it's small enough that maintaining an in-house fork of on old version is an option, so the language designers can make major changes when it's a clear improvement. As library maturity goes, there are some really good ones out there (such as LPEG and LuaSocket), but for some things the documentation is a bit thin. The situation is getting better, though.
- wisty 17y agoI couldn't agree more. Lua is arguably as nice a language as Python, and it has a nice embeddable implementation, but it doesn't have the libraries and documentation.
- kingkongreveng_ 17y agoIf the app you need to script is C++ there are much more appealing options than Lua, which is very C. You get ugly C style code in your C++. QScript, ChaiScript, and projects like boost.python and libperl++, play much better with your C++.
- agladysh 17y agoIf you need boost.python-esque interface for Lua, use Luabind.
- dkersten 17y agoAnd the slightly Lua derived Squirrel. I've considered a number of these for my current app, especially QtScript, Lua and Squirrel, but eventually I settled on embedding a JVM, since it gives me access to a bunch of libraries and lets me use any JVM language (I'm personally using Clojure and Yeti, but users of my app could in theory use other languages).
- dtf 17y agoIf you like boost::python, have you tried Luabind?
- cookiecaper 17y ago>Lua still doesn't really satisfy as a "batteries-included" platform. This is exactly the problem, imo. Lua is a niche language because its benefits only apply to a certain niche, i.e., scripting glue on top of an extant system, because that's where the time investment makes sense. Is Lua so much better that using it is worth losing the convenience of something like Rails or Django? Those things come all bundled up nicely with everything you need for a website. Is it worth the investment to go around and scrape all of these pieces together in Lua? Is Lua going to provide a benefit commensurate with the time you invest in piecing all of that together yourself, including the real possibility that you'll have to write much of the functionality yourself? Or is it simply cheaper and smarter to use Python or Ruby where the frameworks are already composed and widely tested and deployed from the get-go? There's your answer. To the extent that one wants to increase adoption of a language in a certain niche (say, web programming), you need to at least attempt to make it basically competitive. However cool and fast Lua may be, for most people, it's not worth the investment to start from scratch on a framework when Python has Pylons, Django, Pinax, and Ruby has Rails, etc.
- pheon 17y agoyou need to realize lua isnt targeted as a batteries included platform, its design philosophy is minimalist, not junk included but customize for your requirements. where lua absolutely excels is when paired with C (not C++) and not used as "scripting glue" but fully integrated and driving the system. it really appeals to minimalistic / keep it simple philosophy guys which isnt the web community. lua is not a one stop shop and will never be, which probably why it flys under the radar so much - you cant stamp a powered by lua logo on it.
- davidw 17y agoI think it's true you need to watch out for this 'gap' between a full blown, batteries-included language, and something really small. Tcl sort of fell into it when they grew the language and libraries to the point where it's less attractive as a small, embedded language, but never really got it together enough to ship it with all the goodies included, either, meaning you have to round up a bunch of external things to do much with it. It's not a 'happy medium'.
- iamaleksey 17y agoWhile Lua doesn't have many batteries included, it is trivial to expose a C lib-whatever interface to Lua when needed (example - http://github.com/iamaleksey/lua-zmq/blob/master/zmq.c http://github.com/iamaleksey/lua-zmq/blob/master/zmq.c). And there is a c/++ library for almost everything.