Live data from Hacker News

Lua 5.5

lua.org

81–90 of 138 posts

Re: Lua 5.5

#81

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 tha…

> get it to run on SteamOS Huh? I had to do zero extra work to run it on the steam deck.

The version sold in the Steam store runs the Windows build via Proton. (Valve's whole philosophy is you should build one version of your game, and their compatibility layers should be so bulletproof that it runs flawlessly everywhere.)

In this case, I had the Game Pass version. It depends on a custom shared object `love.platform` that talks to Microsoft's cloud APIs to save/load your game and achievements. I used Gemini to write a bridge that implements all the `love.platform` calls in pure Lua, and then use the Linux build of LÖVE to run the game natively.

Works great in KDE. Crashes when launched from Steam. Haven't gotten to why yet.

Re: Lua 5.5

#82
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?

Re: Lua 5.5

#83
post #77

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=…

You kind of always have to go on a quest for a library on the internet, why would lua be any different? For lua, luarocks is its module registry and you can sort by most downloads, which sometimes leads you to buggy modules, but what can you do.

> You kind of always have to go on a quest for a library on the internet

Plenty of languages come with standard libraries that are more than sufficient for handling plenty of tasks.

Re: Lua 5.5

#84
post #4

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

Global-by-default scoping was one of Lua's largest mistakes. I wish they'd fix it, but of course it would break backwards compat.

Strictly speaking, Lua is not global by default. All free names, that is, all names unqualified with `local`, is actually indexed from a table `_ENV`, which is set to `_G`, the global environment. So, all free names are effectively global by default, but you can change this behavior by put this line at the top of your file `local _G = _G; _ENV = {};`. This way, all free names are indexed from this new table, and all access to the global names must explicitly be accessed through `_G`, which is a local variable now. However, I have never seen such practice. Maybe it is just too complicated to accept that all free names are global variables and you have to explicitly make it local.

Re: Lua 5.5

#85
post #69

Earlier quoted context omitted.

There’s no “basically”. Stick a fork in it; it’s done: https://www.python.org/doc/sunset-python-2/

It might not be supported by the consortium, but python2 still lives, slowly, in one place or another: > The RHEL 8 AppStream Lifecycle Page puts the end date of RHEL 8's Python 2.7 package at June 2024. https://access.redhat.com/solutions/4455511 At this point in RHEL it is only "deprecated", not "obsolete".

In RHEL I would never touch system python at all, and would install what every version I needed in a venv and configure any software I installed to use what ever version I needed. I learned the hard way to never mess with system python.

Re: Lua 5.5

#86
post #30

Earlier quoted context omitted.

Ypu could probably run it in wasm. Of course, without access to the DOM it won't go any further than anything else on wasm. The whole thing is nuts if you ask me. So much lost potential.

What is nuts?

Means like "a crazy thing" in slang, I think.

Re: Lua 5.5

#87

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 tha…

> Balatro was one of the biggest games of last year, and I'm sure the tinkerability was a big catalyst to that

Not sure I agree on that point. Balatro is a great game and the mainstream success is warranted, but my gut tells me that the technical implementation was not the catalyst for that. Sure, Lua’s portability could have led to the cross-platform popularity, but a mainstream gamer does not tinker with and mod Balatro at all.

Re: Lua 5.5

#88
post #82

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?

Is transpilation a thing in the Lua world like it is for JavaScript?

Re: Lua 5.5

#89

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 tha…

Reminds me of WhatsApp that was on all devices early on to maximize their network effect.

Re: Lua 5.5

#90

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.

Anywhere where you run hot loops in Lua inside your own hot loop. Game engines and network appliances are the most common use cases.
Post reply on HN