A while ago, I told Github Copilot to write a Lua snippet and it gave me a result that use table.create. I thought it was silly, but now it turns out that the LLM could predict the future 😨
It might have parsed the mirrored GitHub repo which had table.create since January 2024. Plus such a function was a natural one to add, just like on C side we can give size hint when creating a table.
Someone asked on mailing list. It's about table constructors with many values and deep nesting like {1, 1, {1, {1, {1}}}} and so on, but with hundreds of values.
Similar to Teal, I think you have to use global keyword in Lua 5.5. So there is now no confusion between declaring a global variable and assigning value to an existing one
What a crazy coincidence, I saw this when I was looking up Pluto last night, and noticed it said Lua 5.5, and wondered if I had missed the announcement so I looked it up, and they said they're getting ready to release Lua 5.5, but I didn't know when that was written or when they were planning to release it. Now I see this!
The changes for global/local variables seem quite interesting. I wonder if they have some pitfall that I'm not seeing. TBH, I'm not sure if I'll ever enjoy this feature, given that for most projects I'm stuck with whatever LuaJIT supports (which so far is 5.1 with some small features from 5.2 and 5.3).
I'm wondering if with some of the additional performance improvements in this release, lua 5.5 will have closed the performance gap enough for future applications to consider it over luajit.
The problem is that PUC Lua has breaking change after each minor version, and the breaking changes are not just in API, but also in syntax. Which makes it very problematic to upgrade.
And you may not want to stay with a specific PUC Lua version, because it will no longer get any new releases just a few months after the next Lua version is released
LuaJIT doesn't just guarantee you speed, but also backward compatibility, and much-longer-term support (even if Mike Pall can no longer maintain it, OpenResty will likely maintain it).Â
Yes, it's a single sad thing about Lua. Due to compatibility, timing (2006 to 2011) and LuaJIT, the 5.1 is probably still most widely used, in itch io, OpenRest, neovim, games, Luau, etc.
It'd be nice if Lua was forward compatible like Python. For years I targeted 3.8 (due to Ubuntu 20.04 LTS) and never had an issue on newer distros.
OTOH, Lua is pure dep-free C codebase, easy to build, so you can just vendor it and modify/maintain yourself.
Envision Steve Ballmer jumping up and down yelling "stability stability stability stability." I agree that having a platform where the rug isn't pulled out from under you across releases is an essential thing.
To me is not only the speed, but the features (and as others have said, the compatibility issues... I don't want to breaking changes each 5.x release, only after a 6.x major update, please).
I have a project which works on PUC Rio Lua and LuaJIT, but it will move to LuaJIT-only because I want to use FFI, which I prefer to Pallene (which seems to be the closest thing in/for PUC Rio Lua).
Agree. I mainly use LuaJIT for hacking utilities for Linux, and I'd hate to do without Pall's FFI. I can write and have written wrappers, but for the most part, that's a heavyweight way to go about things.
8
u/DPS2004 Jul 01 '25
Is there a changelog anywhere?
7
u/AwayEntrepreneur4760 Jul 01 '25
Declarative globals is awesome
4
u/[deleted] Jul 01 '25
What a crazy coincidence, I saw this when I was looking up Pluto last night, and noticed it said Lua 5.5, and wondered if I had missed the announcement so I looked it up, and they said they're getting ready to release Lua 5.5, but I didn't know when that was written or when they were planning to release it. Now I see this!
7
u/SkyyySi Jul 01 '25
Holy... it actually happened.
6
u/[deleted] Jul 01 '25
NO MORE DEFAULT GLOBALS!!!
3
u/disperso Jul 01 '25
The changes for global/local variables seem quite interesting. I wonder if they have some pitfall that I'm not seeing. TBH, I'm not sure if I'll ever enjoy this feature, given that for most projects I'm stuck with whatever LuaJIT supports (which so far is 5.1 with some small features from 5.2 and 5.3).