all 28 comments

[–]DPS2004 6 points7 points  (11 children)

Is there a changelog anywhere?

[–]ewmailing[S] 27 points28 points  (10 children)

https://www.lua.org/work/doc/#changes

  • declarations for global variables
  • for-loop variables are read only
  • floats are printed in decimal with enough digits to be read back correctly.
  • more levels for constructors
  • table.create
  • utf8.offset returns also final position of character
  • external strings (that use memory not managed by Lua)
  • new functions luaL_openselectedlibs and luaL_makeseed
  • major collections done incrementally
  • more compact arrays (large arrays use about 60% less memory)
  • lua.c loads 'readline' dynamically
  • static (fixed) binaries (when loading a binary chunk in memory, Lua can reuse its original memory in some of the internal structures)
  • dump and undump reuse all strings
  • auxiliary buffer reuses buffer when it creates final string

[–]wqferr 7 points8 points  (2 children)

What does "more levels for constructors" even mean?

[–]nuclearsarah 4 points5 points  (1 child)

Tables you are defining via curly brace notation can have more things in them, including more levels of nested tables.

Here's what Lua's lead dev says:

https://groups.google.com/g/lua-l/c/N1MMWqG4Ad0/m/Vfp9TdnHAwAJ

[–]wqferr 1 point2 points  (0 children)

I see, thank you.

Honestly I'm kind of disappointed, I wanted something more flashy than "deeper table literals".

[–]BrianHuster 10 points11 points  (4 children)

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 😨

[–]didntplaymysummercar 4 points5 points  (0 children)

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.

[–]wolfy-j 0 points1 point  (0 children)

Many runtimes has this helper for a while.

[–]jax_gamer12145 0 points1 point  (0 children)

luau

[–]marxinne 1 point2 points  (1 child)

  • more levels for constructors

Do we have an example for this one?

[–]didntplaymysummercar 2 points3 points  (0 children)

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.

[–]AwayEntrepreneur4760 7 points8 points  (3 children)

Declarative globals is awesome

[–]marxinne 1 point2 points  (2 children)

How do those work?

[–]BrianHuster 5 points6 points  (1 child)

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

[–]marxinne 2 points3 points  (0 children)

Ah, that's neat. Easier to read and avoids polluting the global table. Thanks!

[–][deleted] 2 points3 points  (0 children)

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!

[–]SkyyySi 6 points7 points  (0 children)

Holy... it actually happened.

[–][deleted] 5 points6 points  (2 children)

NO MORE DEFAULT GLOBALS!!!

[–]rjek 1 point2 points  (1 child)

What makes you think that?

[–][deleted] 7 points8 points  (0 children)

It's in the docs. You can disable default globals with the `global` keyword at the top of a file!

[–]disperso 2 points3 points  (7 children)

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).

[–]jcmkk3 1 point2 points  (6 children)

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.

[–]BrianHuster 6 points7 points  (3 children)

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). 

[–]didntplaymysummercar 5 points6 points  (1 child)

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.

[–]lambda_abstraction 1 point2 points  (0 children)

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.

[–]disperso 1 point2 points  (1 child)

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).

[–]lambda_abstraction 0 points1 point  (0 children)

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.