Live data from Hacker News

Why nobody talks about Lua

goplexian.com

31–40 of 78 posts

Re: Why nobody talks about Lua

#31
I started using Lua as an embedded scripting language to drive a pretty complicated process. After a few weeks, i ended up switching to Python. The Lua libraries were pretty weak, the datastructures and builtin functions were wierd and inconsistent, and swig+python made for much faster scripting then exposing c interfaces to lua.

Re: Why nobody talks about Lua

#32

I like Lua as a language. I especially like how easy it is to embed it into another program. I'll be using Lua for scripting my current project. The only thing I really don't like about it is that it treats all numbers as double-precision floats. It can be compiled to use 32-bit ints instead, but I'd really like to have access to both, especially since floating point arithmetic is insanely slow on embedded processors…

If the processor doesn't have an FPU, there's not much of an extra disadvantage to compiling with int32s and then making reals just another data structure, implemented in terms of ints, with a library to manipulate them.

Re: Why nobody talks about Lua

#33
post #19

Lua attracts a lot of devs with a pretty low-key, humble attitude. If you go to a Ruby mailing list and ask people "should I use Ruby for x?" the answer will mostly be a resounding "yes." On the Lua list, people will often tell you "that depends," will advocate for lots of other languages, or even tell you "no, I don't think so." I think that's in part because of Lua's history as an embedded/glue language: many progr…

'If you go to a Ruby mailing list and ask people "should I use Ruby for x?" the answer will mostly be a resounding "yes."'

Really? I don't think so. If it's for Web or desktop stuff, sure. For other things, there are a lot of "it depends".

Seriously, outside the heavy gravity of Planet Rails, Ruby devs are pretty open about what you can reasonably do with Ruby.

Re: Why nobody talks about Lua

#34
At my last company (that's still going, I've just sold out and moved on. . . ) I used Lua for the lion's share of our kiosk content distribution platform. It was perfect, especially considering how many times we had to dip down into C or C++ to get at devices. We built out a tiny host C program that dynamically loaded in modules and frameworks as needed on each kiosk. It was beautiful, FAST, and cross platform (XP/Linux/OS X). I'm back in the web world these days but I miss Lua quite a bit, it's a fantastic little language.

Really, if you're building desktop software I couldn't recommend it highly enough.

Re: Why nobody talks about Lua

#35
post #19

Lua attracts a lot of devs with a pretty low-key, humble attitude. If you go to a Ruby mailing list and ask people "should I use Ruby for x?" the answer will mostly be a resounding "yes." On the Lua list, people will often tell you "that depends," will advocate for lots of other languages, or even tell you "no, I don't think so." I think that's in part because of Lua's history as an embedded/glue language: many progr…

"If you go to a Ruby mailing list and ask people "should I use Ruby for x?" the answer will mostly be a resounding "yes.""

I went. That's not what I found. For example:

http://groups.google.com/group/comp.lang.ruby/browse_thread/...

In fact, while we're on the subject, here's an example of recommendations and praise of Lua on comp.lang.ruby (note: google groups displays it a bit out of order):

http://groups.google.com/group/comp.lang.ruby/tree/browse_fr...

Re: Why nobody talks about Lua

#36
post #24

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…

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

#37
post #24

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…

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

#38
post #31

I started using Lua as an embedded scripting language to drive a pretty complicated process. After a few weeks, i ended up switching to Python. The Lua libraries were pretty weak, the datastructures and builtin functions were wierd and inconsistent, and swig+python made for much faster scripting then exposing c interfaces to lua.

Oh, and the lack of an integer type seemed to make it really difficult to do proper bit shifting--i'd expect this to be the bread and butter of an embedded scripting language.

Re: Why nobody talks about Lua

#39
post #19

Lua attracts a lot of devs with a pretty low-key, humble attitude. If you go to a Ruby mailing list and ask people "should I use Ruby for x?" the answer will mostly be a resounding "yes." On the Lua list, people will often tell you "that depends," will advocate for lots of other languages, or even tell you "no, I don't think so." I think that's in part because of Lua's history as an embedded/glue language: many progr…

'If you go to a Ruby mailing list and ask people "should I use Ruby for x?" the answer will mostly be a resounding "yes."' Really? I don't think so. If it's for Web or desktop stuff, sure. For other things, there are a lot of "it depends". Seriously, outside the heavy gravity of Planet Rails, Ruby devs are pretty open about what you can reasonably do with Ruby.

You're right, I chose a lousy example. Much of my experience with Ruby revolves around Rails, so perhaps that colors my perspective a bit more than I sometimes realize.

Re: Why nobody talks about Lua

#40
post #24

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…

>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.

Post reply on HN