Lua 5.5
New language features in 5.5
- Explicit
globaldeclarations are highlighted as a major change; previously globals were implicit via_ENV/_G. globalis now a reserved keyword, which may break code that usedglobal()helper functions.- For-loop control variables are now read-only; the stated rationale is performance (avoids an implicit
local x = xcopy in every loop) and removing a footgun. - Some see explicit globals as preparation for possibly changing default scoping in a future version.
Globals, scoping, and “global by default”
- Several comments call Lua’s global-by-default behavior one of its biggest mistakes.
- Others point out that technically all free names are table lookups on
_ENV, which can be replaced to sandbox code, but this is rarely used in practice because it’s cumbersome. - Suggested workarounds include replacing
_ENVor adding metamethods on_Gto error on accidental global creation.
Lua 5.1, LuaJIT, and ecosystem fragmentation
- Many projects remain on 5.1 because that’s what LuaJIT targets; performance is the main reason to stay.
- There is debate over how much LuaJIT has backported from 5.2/5.3; it does support some extensions but not the full newer semantics.
- Some want LuaJIT updated to modern Lua; others argue it is intentionally “its own thing,” providing a stable, simpler dialect and focal point for the ecosystem.
- Later Lua versions are seen as a “language fork” by some, especially around math types and environment/sandbox changes.
Ecosystem, libraries, and documentation
- FreeBSD now ships Lua in base; this is seen as a big win.
- Concern: no “extended standard library” for common tasks (HTTP, JSON), forcing users to hunt for libraries.
- Responses mention LuaRocks, Penlight, Luvit, and an ecosystem more like Lisp: many small, “finished” libraries.
- The core community is small; attempts to bless an extended standard library have not gone far.
- There is some disappointment that “Programming in Lua” only goes up to 5.3.
Embedding, games, and upgrades
- Examples of large/real use include ConTeXt on 5.5 betas, LÖVE games (e.g., Balatro), and text MUD clients.
- Lua’s table-centric design and metatables enable hot code reloading and powerful modding.
- Embedded use means hosts often pin a Lua version indefinitely; upgrading (e.g., from 5.1 to 5.5) can break large plugin ecosystems, so many projects simply never upgrade.
Lua on the web
- Some wish browsers would support Lua directly; others strongly oppose fragmenting browser runtimes beyond JavaScript.
- WASM-based Lua and DOM-bridging demos exist, but lack of direct DOM access is seen as limiting.