logoalt Hacker News

Lua 5.5

309 pointsby kmlast Monday at 3:06 PM104 commentsview on HN

Comments

VadimPRtoday at 6:28 AM

One challenge we have with Lua in Mudlet (FOSS text-based MUD client, think something akin to Roblox but for text) is that all of the player-created content is on Lua 5.1, and upgrading to 5.5 would be a breaking change for most.

Has anyone solved an ecosystem upgrade like this?

show 3 replies
bsimpsontoday at 1:11 AM

I recently happened into Balatro through a Game Pass trial. I fell deep down the rabbit hole of trying to get it to run on SteamOS.

It's fascinating to see a commercial game whose source is easily read inside the application bundle, and all the modding opportunities it opens up. (It's written in Lua with LÖVE.) Balatro was one of the biggest games of last year, and I'm sure the tinkerability was a big catalyst to that - people porting it to obscure platforms and making mods to extend the game.

It's also really cool to see how the game handles all the different ecosystems it exists in (Steam, Game Pass, Apple, Android, Nintendo Switch…).

I've got a Nix derivation that ought to be able to run any version of the game in Linux. Now I just need to figure out why it crashes when opened in game mode.

All this is way more effort than just spending the $10 to get it to run in Steam natively, but it's more interesting this way.

show 4 replies
a_t48today at 9:10 AM

I miss working in Lua. Metatables are pretty powerful, and "everything is in a table" made it super easy to do hot reloading. At one point working on an iOS game, I had things set up so that when I hit save on my PC, my phone would pick up the changes and just start running the new code, as all persistent state was stored in a special table. Someday I need to look into getting the same kind of environment going for robotics, it was really a superpower.

cturtlelast Monday at 4:36 PM

One of the new features I found interesting, declarations for global variables, is buried in the reference manual. Here's a link to the section that discusses it: https://www.lua.org/manual/5.5/manual.html#2.2

show 3 replies
gucci-on-fleekyesterday at 5:58 AM

ConTeXt has been using beta versions Lua 5.5 for a few years now, so you can look through its source [0] or try running it [1] if you're curious what a large codebase written in Lua 5.5 looks like.

[0]: https://codeberg.org/contextgarden/context

[1]: https://wiki.contextgarden.net/Introduction/Installation

Kerrickyesterday at 9:33 PM

We never got a new edition of Programming in Lua for 5.4... does that mean we won't ever get one for 5.5?

show 2 replies
klaussilveirayesterday at 10:41 PM

> declarations for global variables

That's huge. I wish LuaJIT adopted this, or at least added a compile time flag to enable it.

show 1 reply
maxpertyesterday at 10:03 PM

I feel like Lua is absolutely underrated. I just wish one of the mainstream browsers actually puts their foot down and starts supporting Lua as scripting language.

show 7 replies
parlortricksyesterday at 3:42 AM

Excellent new release, now for Fennel and Love2d to update, fun times!

show 1 reply
ksymphyesterday at 10:22 PM

> for-loop variables are read only

Seems like an odd change, I wonder what the rationale is. Just making it clear to people new to the language that you can't adjust it mid-loop to change the loop count I guess?

show 3 replies
JSR_FDEDtoday at 3:47 AM

For what kinds of applications is LuaJIT being used? I’ve always found the standard interpreter fast enough for my needs. Especially when compared to Python.

show 2 replies
robofanaticyesterday at 10:15 PM

How hard is it to put a simple hello world example on the homepage.

show 3 replies
sunshine-oyesterday at 9:37 AM

I never coded in Lua but I found out recently that Lua is now in FreeBSD base [0] This is huge for Lua and FreeBSD.

Now something that worry me is whenever you need to make an HTTP request or parse some JSON you need to go on a quest for a "library" on the Internet. It doesn't seems to have a (semi-)official "Extended Standard Library" I can quickly trust.

- [0] https://man.freebsd.org/cgi/man.cgi?query=flua&apropos=0&sek...

show 3 replies
mysterEFrankyesterday at 10:30 PM

OG torch strikes back?

gscklast Monday at 4:31 PM

Cannot wait for another version of Lua to sit unused basically everywhere.

Truly is a shame, everything seems to have settled on 5.1 for the most part without ever being updated, or any intention of it being updated. Some really nice features post 5.1

I understand each version of Lua introduces breaking changes in the language, which isn't great as the language becomes fragmented (Or not really, once again 5.1 is pretty ubiquitous)

show 4 replies
andrewmcwatterslast Monday at 4:02 PM

Interesting, it looks like you can use ´global myvar’ now, as compared to ´myvar’ implicit globals, say from back in 5.1, or ´local myvar’.

It’s worth noting that global is a reserved keyword now, so environments that had a ´global()´ function for escaping environments will now need to rename their helper function.

show 1 reply
artemonsteryesterday at 9:36 PM

please resurrect Mike Pall

show 1 reply