Live data from Hacker News

Why nobody talks about Lua

goplexian.com

11–20 of 78 posts

Re: Why nobody talks about Lua

#11
post #5
post #3

Earlier quoted context omitted.

It's a shame that it's mostly being used for games. It's got incredible flexibility and power and even the mainline runtime (sans JIT) is surprisingly performant. More people should give it a try.

Python and Ruby largely continue the class-based object oriented model and are thus easy to pick up if you come from a C++/Java background. While JavaScript is prototype-based, and thus somewhat exotic, it at least maintains the syntactic heritage of C/C++, so it's not as scary as it otherwise might be for beginners. Plus most in the web development background have already known the language for years. Perhaps the re…

_why wrote a web server in lua, just for fun. It's available as a lua rock (like a ruby gem or python egg).

Re: Why nobody talks about Lua

#12
post #4

Lua is used a lot, but usually as a command and control language. Meaning that it is always used together with another language/system, where performance matters, both for runtime and development time, and memory constrains.. One of the the reasons that it hasn't caught on the server side is that the server engineers are lazy (in the friendly way), and have it easy. If you have performance problems, you can just thro…

I think the explosion of node.js is actually evidence of what you're saying; the web guys who were scared of the server are taking their javascript skills there via node.js.

Perhaps it could happen when a generation of iPhone developers who have written games in Lua decide they want to do some server side development.

I have less hope that Lua will take off though. Appropriately, I'm giving a talk on Lua/Erlang integration at Erlang Factory in March, which will be on using Lua as you describe - for command and control of a larger Erlang system.

Re: Why nobody talks about Lua

#13
post #9

Because the arrays start at 1.

Dude, you can find a reason to write off every language in existence. Lisp has all those parens. Python has the whitespace. Perl...is Perl. Etc. Nothing's perfect.

Lua's a pretty good language, though. It's completely replaced Python as my default language (much like Python replaced Perl years before), because, while it too has its surface annoyances, it makes a lot of other very intelligent trade-offs.

For example, indexing arrays from 1 is a consequence of ensuring that Lua would have a syntactic subset usable as a data description language by non-programmers. It's almost identical to Javascript's JSON in that regard, but has been used in production as such for well over a decade.

Likewise, Lua's rather spare standard library is because the language strictly* limits itself to the ANSI C standard. In exchange, though, it's portable to literally anything with an ANSI C compiler, including freaking Legos (http://www.hempeldesigngroup.com/lego/pbLua/). The whole thing fits in a 200ish KB library, too. Not bad for something as expressive as Scheme and Python.

* With the exception of dynamic linking, which can potentially provide everything else down the line.

Re: Why nobody talks about Lua

#14
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 without an FPU, but sometimes I really need it.

Re: Why nobody talks about Lua

#15
post #9

Because the arrays start at 1.

Dude, you can find a reason to write off every language in existence. Lisp has all those parens. Python has the whitespace. Perl...is Perl. Etc. Nothing's perfect. Lua's a pretty good language, though. It's completely replaced Python as my default language (much like Python replaced Perl years before), because, while it too has its surface annoyances, it makes a lot of other very intelligent trade-offs. For example,…

Yeah, I like Lua. I was just trying to be funny :)

Re: Why nobody talks about Lua

#16
post #7

Much of Adobe Lightroom is written in it, right?

Yes.

From Mark Hamburg's intro to _Lua Programming Gems_, pg. xii:

"...Large portions of Lightroom ended up getting written in Lua including the object-relational mapping layer for the database and the layout system for views. [...] As a result, we had an application that was smaller by far than some of its competitors, easy to change, largely cross-platform in its implementation, and suffered essentially no compile-link cycle. [...] Lua is both very expressive compared to most native languages and sufficiently efficient that you can let it do a lot more of the work than one might be tempted to do in other scripting languages."

Re: Why nobody talks about Lua

#17
I think one of the reasons that Lua gets less attention (outside of certain niches, most notably the game industry) is that, to get the most out of it, you need experience with C or C++. The libraries available for standalone Lua are somewhat small compared to (say) Python, because in most cases you'd just use C libraries anyway. In exchange, though, you can leave each layer to focus on what it does best.

This probably rules it out for people who only know Python, Ruby, PHP, etc., which in turn limits exposure among web developers, who seem to have disproportionate presence on blogs.

Re: Why nobody talks about Lua

#18

Roberto Ierusalimschy, Pontifícia Universidade Católica do Rio de Janro, is the author of Lua and also author of several excellent books about Lua. Lua is a very nice language with a small footprint, powerful structure, and a fascinating and flexible object model. Roberto is scheduled to speak about Lua at Stanford in the Stanford EE Computer Systems Colloquium from 4:15-5:30 in Gates B01. As is usual for the Collo…

Should be http://ee380.stanford.edu

Re: Why nobody talks about Lua

#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 programmers who work with Lua don't use it as their primary language, and so they don't have the same urge to hard-core advocacy and evangelism that many other languages' users have.

Re: Why nobody talks about Lua

#20

I think one of the reasons that Lua gets less attention (outside of certain niches, most notably the game industry) is that, to get the most out of it, you need experience with C or C++. The libraries available for standalone Lua are somewhat small compared to (say) Python, because in most cases you'd just use C libraries anyway. In exchange, though, you can leave each layer to focus on what it does best. This probab…

You're right, but I think this is much less true now than it was a few years ago. With the libraries developed by the Kepler project (for example) you can do quite a bit of useful coding without ever touching C.

http://github.com/keplerproject

I do quite a bit of work with Lua and never use it with C.

Post reply on HN