Live data from Hacker News

Why Lua?

blog.datamules.com

11–20 of 142 posts

Re: Why Lua?

#11
On the integration front, one thing I will also add is that in .NET integrating Lua with your program feels pretty close to being a first-class citizen. Very nice.

Re: Why Lua?

#12
The reason its not so popular? IMHO because we live in a society that favors 1sec landing pages, customized per individual options, complexity that rivals air skyscrapers and shrinked wrapped ready-to-go solutions. This is not LUA.

LUA is just one tool in the tool box - its not the tool box.

Re: Why Lua?

#13
post #8

In lua, the metatable is the killer feature that python doesn't have.

When my main language was C, I used to feel that dynamically mutating or self-modifying data structures were somewhere between black magic and heresy.

I have found that being able to place arbitrary constraints on the way my programs store things in (seemingly simple) data structures has been very, very powerful.

Re: Why Lua?

#14
The more I learn about Lua's design and implementation, the more impressed I am. It's very rare to see software that does so much with so little code. The design is extremely clean and the code is extremely fast.

The C API is easy to use and gives good performance, and yet encapsulates enough of the VM's implementation that C modules are source and binary compatible with both Lua and LuaJIT, two very different implementations of Lua. Note that the C API was designed before LuaJIT was even written, so this API was designed without the benefit of seeing how different implementations of Lua might vary.

The source is very readable for the most part; my only stumbling block is that their naming of types and variables is extremely terse at the cost of readability sometimes, and the extensive use of macros can sometimes can require a lot of jumping around. But Lua is an impressive achievement that I frequently refer to for design inspiration.

Re: Why Lua?

#15
post #9

lua (the language and core libraries) is stable and small. many developers are attracted to node.js or rails due to the community ("look, everyone else is doing it!"), ecosystem (abundance of modules/gems to choose from), and rapid release cycles. lua seems to have more of a relaxed, niche community among game developers and scripting language embedders. i've been using lua for about a week so far, for a music player…

> add unicode support

This won't happen soon. Lua targets ANSI C and only ANSI C.

C11 includes new character types to support unicode, but I imagine that the Lua implementers will take their time.

Plus there's implications for embedded situations.

If you need unicode (and most do), there are libraries and patches that do a reasonable job.

Re: Why Lua?

#16
The worst problem with Lua is that arrays start at 1. That is way too bad for me to use it. I only use it to configure Awesome WM, but it sucks for everything else IMO because of "tables" starting at 1.

Re: Why Lua?

#17
post #16

The worst problem with Lua is that arrays start at 1. That is way too bad for me to use it. I only use it to configure Awesome WM, but it sucks for everything else IMO because of "tables" starting at 1.

It is a minor mind shift. The kind I find alternately annoying, or a fun challenge, unpredicatbly.

When I was doing Lua stuff I ended up writing some FP-style helpers and other functions for iteration. This cut down on the number of times I had to think about the table indexes (and was helpful in general).

Re: Why Lua?

#18
post #9

lua (the language and core libraries) is stable and small. many developers are attracted to node.js or rails due to the community ("look, everyone else is doing it!"), ecosystem (abundance of modules/gems to choose from), and rapid release cycles. lua seems to have more of a relaxed, niche community among game developers and scripting language embedders. i've been using lua for about a week so far, for a music player…

There are several server side Lua options with coroutines.

Re: Why Lua?

#19
To echo chubot: Why isn't Lua more widely used?

* It lacks an easy-to-use symbolic debugger.

* It lacks a first-rate IDE.

* It lacks a standard way for people coming from OO/Java to define objects and interfaces.

* It lacks a GUI toolkit.

* It has a great set of manuals. It lacks an O'Reilly book with a woodcut animal on the cover.

* Arrays indexes start at 1.

Except for the last item, these are all relatively small things that are simply waiting for someone to come along and do them. This is a testament to the great design of the language.

And many of these things do exist, it's just the Lua style seems to be to understate the achievements to the point that folks can't tell the big new stuff from the abandoned projects.

Re: Why Lua?

#20
post #9

lua (the language and core libraries) is stable and small. many developers are attracted to node.js or rails due to the community ("look, everyone else is doing it!"), ecosystem (abundance of modules/gems to choose from), and rapid release cycles. lua seems to have more of a relaxed, niche community among game developers and scripting language embedders. i've been using lua for about a week so far, for a music player…

> add unicode support This won't happen soon. Lua targets ANSI C and only ANSI C. C11 includes new character types to support unicode, but I imagine that the Lua implementers will take their time. Plus there's implications for embedded situations. If you need unicode (and most do), there are libraries and patches that do a reasonable job.

I'm fine with C-style strings, but once in a while there are things for which a bit of UTF-8 tagging would be good enough.
Post reply on HN