Hacker News new | ask | show | jobs
by chubot 5258 days ago
Why isn't Lua more widely used? One reason is a consequence of it being an embedded language. Lua has had 5 major versions which are very incompatible with each other. You're just supposed to stick with the previous version until you upgrade your code.

I read all the Lua papers, and they are quite fond of "getting it right" (which is refreshing). They will break things to get it right, whereas other languages stick with all their old design warts in the name of compatibility. I like this approach, but it comes at the expense of popularity.

Compare Lua with Python, which has had basically 1 major version for 20 years Python 1.x are all compatible with 2.x -- that was a license change; and Python 3 is having adoption troubles which proves the same point. Python 3 was the chance to "get things right", or fix old design warts, but you can see what a big impact it's having on adoption, fragmentation of libraries, etc.

The other reason is that embedding a language isn't as common a use case as a scripting language. I've tried to write stuff in Lua rather than Python, but really Python's "batteries included" philosophy just kills any advantage Lua has.

The main reason I would like Lua is so you can distribute stable (small) executables... but when you're starting out Python is a lot easier. You don't want to download LuaSocket or whatever and mess with the build system.

4 comments

It's easier to break reverse compatibility when your whole language is a 200k DLL and MIT Licensed. If people need to stick with version 4.0, it's realistic to maintain an in-house fork.
Why isn't Lua more widely used?

I think the major, overwhelming reason is because it has no standard library, much less a package-ecosystem such as RubyGems or Python eggs.

You do know about LuaRocks, right? It's not as robust or vibrant as the Ruby or Python equivalent, but it certainly does exist.

http://luarocks.org/repositories/rocks/

Ah, I did in fact not know about it, thanks for the pointer!

Maybe there's still hope! ;-)

This could definitely stand to be better. I only learned about LuaRocks by googling around when make failed to build LuaSocket and the README was useless. By then I had been using Lua for about 3 years.
The part about the package ecosystem is not true. Check out luarocks [1]. It's not as well developed but it's certainly there.

1: http://luarocks.org/

Not only does it lack a standard library, it lacks a standard metaobject protocol. The fact that a MOP can be implemented in Lua is very nifty, but not having a standard one makes an ecosystem of shared code very difficult.
I don't know whether this is in fact true for the Lua community, but surely this is not necessarily true in general. MOP is not part of CLOS as defined by the standard, but that doesn't seem to create horrible problems (especially with Closer)
Is ability to break compatibility due to being embedded?

I recall that MS ships with each game the exact version of DirectX it need, so they are free to improve it without being hamstrung by back-compatibility.