Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One, keep in mind that Lua has the version 5.x. It is an accumulation of early user experience just like JS. I haven't said Lua was designed better from the start. I have merely stated that Lua in 2012 is probably better than JavaScript in 2012 (and I was careful enough to add a word "probably" :-).

Two, core languages don't matter here because they are fundamentally similar to each other at the core level (dynamic and considerably weak typing, unified object-array, first-class value from missing indexing, semi-working lexical scopes and much more). The pain points of Lua tended to be same to those of JavaScript in my professional experience.

Three, the language is not a mere combination of syntax and semantics. Any evaluation should also account for user bases and ecosystem, and in my very humble opinion Lua spectacularly fails at both. I'm not going to assume the alternative reality---Lua has a sizable user base and its ecosystem is worse even for that user base.




> ... user bases and ecosystem, and in my very humble opinion Lua spectacularly fails at both.

I think that call depends on your use case. If you've ever tried embedding v8 or spidermonkey you might have a different opinion.

For instance we use to run the entire game state for multiple game titles I worked on in Lua. This was on the PSP where we only had a 400kb block of execution space and a 333MHz MIPS processor(system memory was 8mb w/ 24mb for video + audio).

Those types of environments are where Lua shines which lets you use a scripting language that scales from nothing up to full-blown systems.


> I think that call depends on your use case. If you've ever tried embedding v8 or spidermonkey you might have a different opinion.

I'm saying this in the embedded perspective (my professional involvement with Lua was primarily in that form). The lack of package manager might be acceptable as an embedded language---the lack of quality library isn't. The embedded story masks the weakness in the ecosystem because you can somehow make everything from scratch, but when you are programming at large the story becomes a disaster (combined with common symptom of dynamically and weakly typed languages).

I don't doubt Lua is a good language to embed. I doubt Lua is a good language to write a large software, especially after having worked with more than 300K lines of Lua code in a single code base.


I thing any dynamic language starts falling over at that scale. Lua, JS and the like make great glue and logic bridges but I won't want to use them across the whole stack.


I first mention that JS has been actually successful in non-glue areas :) Dynamic languages are hard to scale, but it is possible after some headaches.

The lack of quality library also means that you are even more risky when you are writing a small program (because you have less incentive to write it yourself). I have experienced multiple times that even the existing libraries (including the standard ones) had crucial flaws and no one seems to be bothered to fix that. Also in the embedded setting the use of snippets, rather than proper libraries, are more common as libraries can be harder to integrate, and unfortunately we are left with PHP-esque lua-users.org for Lua...


I was assuming alternative reality. The sole reason why JS got the popularity that it did is because it was the one and only browser scripting language. If Lua was one, then it'd get the same popularity boost instead (and all the great tooling, large community etc that came with it).


> If Lua was one, then it'd get the same popularity boost instead (and all the great tooling, large community etc that came with it).

And there are so many languages with no such popularity boost that nevertheless have much better tooling than Lua. In fact, JS is very exceptional (in that the growth drove the tooling) and in many cases the tooling tends to keep up with the growth---Lua didn't, even though it could have done better. The alternative reality is an easy way to excuse this situation but also meaningless here.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: