Hacker News new | past | comments | ask | show | jobs | submit login

It's widely regarded as a highly performant and very well-engineered runtime for a popular language. For a long time it was the go-to implementation you would reach for if you a) wanted lua scripting (common in game development) and b) wanted high performance.

I think nowadays though, the landscape has changed quite a bit since when luajit was at its peak of popularity.

a) Lua is not necessarily the language one would always choose for scripting, in the first place. There's lots and lots of scripting languages to choose from these days. (It's also increasingly common nowadays for indie gamedev to happen entirely within a game editor, like Unity or Unreal, which provide their own scripting systems. That fact alone has killed a lot of interest in lua.)

b) If you do want to use lua, the features of the official implementation have progressed a lot since v5.1 (which luajit is pinned to), and its performance has improved over the years.

c) There are other competing lua and lua-adjacent implementations to consider as well, like OpenResty's luajit2 or Roblox's Luau.




b)

You don’t really need these features cause Luas 5.x are mostly rehashes of the ideas rather than successive versions.

The team should have frozen it at 5.1, backport everything useful (yield across * basically) from 5.2 and call it done, only fixing bugs and tuning performance. That’s essentially what LuaJIT did/does.

Instead the “upstream” has 4 versions of the same thing with ecosystem and codebases fragmented as a UK flag, for no good reason. LuaJIT fixes that by being awesome, but lives under the shadow of n+1 stereotype, despite being a true engineering project rather than a chain of experiments. Tbh I’m glad I left Lua world many years ago.


The integer and bitwise addition are pretty nice, lua5.2+ adds more complexity for luajit to upgrade and sync with, but for scripting I feel the new lua versions are great, still small, flexible and more powerful. other than games, lua is very important to embedded systems.


Genuinely, what’s nice about integers and bitops? Lua always had integers: 1, 16, 42, -8. All you have to do is to floor division. Bitops and full 64-bit ops are so rare and fringe that a library would do (and it did).

for scripting I feel the new lua versions are great, still small, flexible and more powerful

It sounds so strange to me. Great in what? _ENV is the same setfenv() just in the other hand. Yielding across meta and C is nice, but should have been done in 5.1.6 regardless. __{pairs,ipairs} was just dancing around the same old tree as well. GC and interpreter improvements were independent of 5.x flavor and could be backported. Integers are pointless, sorry for the pun. 5.(n+1) may seem “more powerful”, but only because authors of Lua consciously leave 5.(n) undercooked. It’s adhd-rewrite-based development.

other than games, lua is very important to embedded systems

If you mean nodemcu, it stuck in 5.1 too. Everyone who did anything practical stuck in it, because they had shit to maintain. It’s very hard to explain to an innocent user why they have to periodically rewrite their scripts and bump fragile deps for this new “elle yu aeh” thing.


I use it for embedded boards, to run scripts and cgi, and sometimes do bitops too. based on what you described, it looks like someone should backport whatever makes sense and keep 5.1.x as a new language, and sync luajit with that? I have yet to use luajit.


I'm more familiar with luajit than Lua itself (as a project I mean). I'd be curious to know more about the fragmentation that vanilla Lua has. I know the issues that the luajit devs have with the features themselves but I wonder how and why those are decided and implemented. Is there an article or blog that goes into more details? Google isn't helping me here haha.


It’s from a simple fact that there are rocks that were not maintained seriously (as in “business”), and there are big embedders that work as version anchors. As a result, rocks were full of 5.?-specific at the times of 5.2/3, cause people have no time nor desire to reimplement things. Idk how it is now, but my bet is on nothing changed, some popular libs became multi-headed. Lua-http doesn’t even list 5.4 as a target. Maybe 5.4=5.3, can’t remember. But if daurnimator decided to ignore it, oh my.

As of motivation, I guess the best source is their mailing list around release dates. It was hot every time. Idk if anyone blogged about it, maybe just ask there.



Ah, visited this first, sorry for the noise https://daurnimator.github.io/lua-http/0.4/


Re (b) – yes, 5.4's VM introduces a generational garbage collector and special-case instructions for numeric types which consistently improve performance, at least even in the general-purpose programs that I run (gamedev and the VM as a compilation target.)

That being said, I use Lua on an architecture that LuaJIT doesn't support anyway – 68k.


openresty/luajit2 is a small number of extensions. Picking or not picking it won't make a huge difference. It's interesting that Roblox has become interested in making Luau usable outside of Roblox and shipped appropriate changes and docs for this in the last few years.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: