frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Lua 5.5

https://lua.org/versions.html#5.5
151•km•1d ago

Comments

andrewmcwatters•1d ago
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.

darubedarob•15h ago
But.. why ? Globals are just variables that reside in the wrapping env table that also contain the C functions. If a closures is a onion of table lookups out of the function context from local -> function scope -> global scope is simply the last lookup before a not found variable with nil is declared?
andrewmcwatters•6h ago
Module exports with side effects, and setting environments doesn’t guarantee global access.
gsck•1d ago
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)

ronsor•1d ago
The real reason everyone settled on Lua 5.1 is because that's the version LuaJIT is compatible with, and most people are unwilling to give up the performance gains.
Rochus•21h ago
And Luau.
pull_my_finger•23h ago
5.1 (by way of LuaJIT) gets a lot of use, but to suggests no one uses the modern versions is just not true. Lua being an embedded language just takes the pressure away to upgrade. It's a feature, not a bug.
BugsJustFindMe•23h ago
> everything seems to have settled on 5.1

Not exactly. LuaJIT has backported various hot features from 5.2 and 5.3 as long as they're unlikely to break 5.1 code.

petcat•2h ago
I'm pretty sure that's only OpenResty's distribution of LuaJIT.

I think the real LuaJIT is strictly 5.1

reactordev•1h ago
No, real LuaJIT has some features from 5.2 and 5.3

https://luajit.org/extensions.html

Tharre•1h ago
Not true, see "Extensions from Lua 5.2" here: https://luajit.org/extensions.html
thayne•1h ago
True. But

1. The luajit documentation basically just had a list of features. AFAIK there isn't any documentation that combines the 5.1 reference with luajit extensions (including things that were backported)

2. In some cases, for example Neovim, luajit extensions aren't guaranteed to be available. It just says there will be a lua runtime compatible with 5.1. Which means a truly portable neovim plugin can't use those extensions

3. There are features from later lua versions I would like to have (in particular <const> and <close>) that will probably never get backported.

4. Some features require luajit to be built with special flags

cturtle•1d ago
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
parlortricks•19h ago
Excellent new release, now for Fennel and Love2d to update, fun times!
derstander•10m ago
Only a dabbler in Love2d here but I’d expect that update to be a bit down the line. If I’m not mistaken the current Love2d version 11.5 is (mostly) tied to Lua 5.1 because of LuaJIT, though I understand some later Lua features are backported. And the changelog for the in-dev 12.0 release talks about compiling Love2d for Lua 5.4 as if it’s an optional thing.

I don’t really follow LuaJIT too closely so I’m not sure if they’re even targeting Lua 5.4 let alone 5.5. I remember reading some GitHub issue that suggested some of the design decisions in Lua 5.4 wouldn’t really support LuaJIT goals re: performance.

With that said I’ve been enjoying Love2d even with Lua 5.1 features — as a hobbyist it works just fine for me.

Would certainly appreciate any corrections by those more in-the-know though!

gucci-on-fleek•16h ago
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

sunshine-o•13h ago
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...

Fwirt•2h ago
The Lua ecosystem is more like the Lisp ecosystem than Python. The language is small enough that there’s a lot of stuff out there that’s just… finished. Hasn’t been updated in 10 years but still works. The LunarModules org tries to gather it up and keep it compatible.

For an extended standard lib, the closest thing is probably Penlight. https://github.com/lunarmodules/Penlight If you want async IO, sockets, etc, check out Luvit. https://luvit.io

Lua is really designed as an extension language but it’s such a nifty little language that sometimes you really wish you could use it in place of Python or Perl, which is why LuaJIT is so popular. But LuaJIT is really just one guy’s project. Its metaprogramming features are really nice and let you build some Lisp-style DSLs, and if you want full Lisp syntax you can drop in Fennel. If you’re just writing extension code you often don’t need a standard lib because it’s easier just to roll your own function to fill the gap.

Personally, I found it easier and quicker to just read the reference manual to learn the language. It’s small and simple enough that you shouldn’t have trouble getting up to speed if you have a couple other imperative languages under your belt. IMO metatables are much easier to work with than JavaScript’s prototype inheritance.

Kerrick•1h ago
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?
sigzero•52m ago
Oh I hope that don't do that.
artemonster•1h ago
please resurrect Mike Pall
thayne•56m ago
Mike Pall made a commit to LuaJIT just a couple of weeks ago.
altairprime•1h ago
List of changes: https://lua.org/manual/5.5/readme.html#changes
maxpert•48m ago
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.
klysm•44m ago
Curious how this fits in with WASM
1313ed01•39m ago
If they can lock it to some version to avoid breaking code every time there is a new Lua version. Or Lua stop making breaking changes.
tormeh•30m ago
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.
sellmesoap•21m ago
I think that's doable. https://github.com/zacharie410/lua-browser-dom-demo
inejge•11m ago
> I feel like Lua is absolutely underrated.

This sounds like an offhand Youtube comment, I'm afraid. Underrated how? Its principal strength, easy embedding with the ability to work as an extension language, is well known in the circles where it matters. The authors never gave an impression that they'd aim to make it a language to bury all other scripting languages, which I find refreshing in the winner-take-all culture of programming language discussion. Lua is modest and works well for what it is. No need to go all grandiose.

> I just wish one of the mainstream browsers actually puts their foot down and starts supporting Lua as scripting language.

I sincerely hope not, that would be a very counterproductive dilution of effort. Browser authors already have their plate full with all other web platform problems.

robofanatic•36m ago
How hard is it to put a simple hello world example on the homepage.
BanazirGalbasi•21m ago
Because Lua's Hello World is just `print("hello, world")`, which looks a lot like Python and doesn't tell you much about actually using the language.
robofanatic•9m ago
The point is, it shouldn’t be too hard just to find an example and get a sense of the language.
ksymph•29m ago
> 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?

pvitz•20m ago
From the manual:

   The control variable in for loops is read only. If you need to change it, declare a local variable with the same name in the loop body.
Also [0]: Roberto Ierusalimschy > So what's the rationale to make them constant now? Does it have performance > reasons?

Yes. The old code does an implicit "local x = x" for all loops, in case you modify 'x'. With the new semantics, the code only does it when you ask for it.

[0] https://groups.google.com/g/lua-l/c/SlAG5QfpTac

GranPC•16m ago
In previous versions, you could change it mid-loop. This apparently caused some unintuitive behavior when paired with generators (e.g. `for k, v in pairs(table)`).

I haven't run into this myself, but it does make sense, and eliminating this footgun sounds like a good idea.

mysterEFrank•21m ago
OG torch strikes back?
klaussilveira•10m ago
> declarations for global variables

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

shmerl•8m ago
Yeah, I wish someone would pick up LuaJIT development. From what I've heard it's in practice isn't developed anymore and is stuck at Lua 5.1 still.

Fabrice Bellard Releases MicroQuickJS

https://github.com/bellard/mquickjs/blob/main/README.md
627•Aissen•5h ago•246 comments

X-ray: a Python library for finding bad redactions in PDF documents

https://github.com/freelawproject/x-ray
47•rendx•57m ago•12 comments

Terrence Malick's Disciples

https://yalereview.org/article/bilge-ebiri-terrence-malick
57•prismatic•3h ago•9 comments

Perfect Software – Software for an Audience of One

https://outofdesk.netlify.app/blog/perfect-software
62•ggauravr•3d ago•17 comments

Lua 5.5

https://lua.org/versions.html#5.5
152•km•1d ago•39 comments

We replaced H.264 streaming with JPEG screenshots (and it worked better)

https://blog.helix.ml/p/we-mass-deployed-15-year-old-screen
247•quesobob•4h ago•163 comments

Help My c64 caught on fire

https://c0de517e.com/026_c64fire.htm
47•ibobev•3h ago•11 comments

Towards a secure peer-to-peer app platform for Clan

https://clan.lol/blog/towards-app-platform-vmtech/
63•throawayonthe•5h ago•14 comments

HTTP Caching, a Refresher

https://danburzo.ro/http-caching-refresher/
26•danburzo•3h ago•4 comments

Un-Redactor

https://github.com/kvthweatt/unredactor
25•kvthweatt•3h ago•29 comments

Microspeak: North Star – The Old New Thing (2015)

https://devblogs.microsoft.com/oldnewthing/20151103-00/?p=91861
4•rbanffy•27m ago•1 comments

Adobe Photoshop 1.0 Source Code (1990)

https://computerhistory.org/blog/adobe-photoshop-source-code/
399•tosh•5d ago•118 comments

Meta is using the Linux scheduler designed for Valve's Steam Deck on its servers

https://www.phoronix.com/news/Meta-SCX-LAVD-Steam-Deck-Server
463•yellow_lead•5h ago•242 comments

Instant database clones with PostgreSQL 18

https://boringsql.com/posts/instant-database-clones/
354•radimm•14h ago•145 comments

I didn't realize my LG TV was spying on me until I turned off this setting

https://www.pocket-lint.com/lg-tv-turn-off-live-plus/
37•fcpguru•1h ago•19 comments

Fifty problems with standard web APIs in 2025

https://zerotrickpony.com/articles/browser-bugs/
42•dhruv3006•5d ago•6 comments

Toad is a unified experience for AI in the terminal

https://willmcgugan.github.io/toad-released/
110•nikolatt•1d ago•26 comments

Go-boot: bare metal Go UEFI boot manager

https://github.com/usbarmory/go-boot
49•nateb2022•5d ago•12 comments

Space Math Academy

https://space-math.academy
31•dynamicwebpaige•3d ago•10 comments

Astrophotography Target Planner: Discover Hidden Nebulas

https://astroimagery.com/techniques/imaging/astrophotography-target-planner/
45•kianN•4d ago•3 comments

Executorch: On-device AI across mobile, embedded and edge for PyTorch

https://github.com/pytorch/executorch
103•klaussilveira•5d ago•15 comments

LAVD: Meta's New Default Scheduler [pdf]

https://lpc.events/event/19/contributions/2099/attachments/1875/4020/lpc-2025-lavd-meta.pdf
13•todsacerdoti•3h ago•1 comments

What makes you senior

https://terriblesoftware.org/2025/11/25/what-actually-makes-you-senior/
170•mooreds•4d ago•82 comments

Local AI is driving the biggest change in laptops in decades

https://spectrum.ieee.org/ai-models-locally
155•barqawiz•22h ago•156 comments

Fixed-Wing Runway Design

https://www.wbdg.org/building/aviation/fixed-wing-runway-design
12•DarkContinent•3h ago•8 comments

An initial analysis of the discovered Unix V4 tape

https://www.spinellis.gr/blog/20251223/?yc261223
72•DSpinellis•4h ago•4 comments

10 years bootstrapped: €6.5M revenue with a team of 13

https://www.datocms.com/blog/a-look-back-at-2025
257•steffoz•15h ago•93 comments

iOS 26.3 brings AirPods-like pairing to third-party devices in EU under DMA

https://www.macrumors.com/2025/12/22/ios-26-3-dma-airpods-pairing/
186•Tomte•16h ago•147 comments

Font with Built-In Syntax Highlighting (2024)

https://blog.glyphdrawing.club/font-with-built-in-syntax-highlighting/
137•california-og•12h ago•28 comments

Test, don't just verify

https://alperenkeles.com/posts/test-dont-verify/
170•alpaylan•9h ago•124 comments