News for hackers. Stuff that matters.
Re:Why nobody talks about Lua by chipsy on Thursday February 11, 2010 @08:21PM (#1119391)
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.

Re:Why nobody talks about Lua by silentbicycle on Thursday February 11, 2010 @08:41PM (#1119442)
> 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.

Re:Why nobody talks about Lua by cookiecaper on Thursday February 11, 2010 @11:01PM (#1119716)
>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.

Re:Why nobody talks about Lua by pheon on Thursday February 11, 2010 @11:20PM (#1119745)
you 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.

Re:Why nobody talks about Lua by capablanca on Friday February 12, 2010 @08:17AM (#1120444)
What is the best example of this combo ?

Also, the idea reminds me of this: http://c2.com/cgi/wiki/wiki?AlternateHardAndSoftLayers

Re:Why nobody talks about Lua by davidw on Friday February 12, 2010 @03:51AM (#1120110)
I 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'.
Re:Why nobody talks about Lua by est on Friday February 12, 2010 @02:20AM (#1120000)
Python kicked ass for it's standard library.
Re:Why nobody talks about Lua by iamaleksey on Friday February 12, 2010 @09:14AM (#1120566)
While 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).

And there is a c/++ library for almost everything.

Re:Why nobody talks about Lua by wisty on Thursday February 11, 2010 @09:47PM (#1119581)
I 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.
Re:Why nobody talks about Lua by kingkongreveng_ on Thursday February 11, 2010 @10:03PM (#1119608)
If 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++.

Re:Why nobody talks about Lua by dkersten on Friday February 12, 2010 @04:16AM (#1120138)
And 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).

Re:Why nobody talks about Lua by dtf on Friday February 12, 2010 @05:47AM (#1120239)
If you like boost::python, have you tried Luabind?
Re:Why nobody talks about Lua by agladysh on Friday February 12, 2010 @01:56AM (#1119956)
If you need boost.python-esque interface for Lua, use Luabind.