Lua 5.5

New language features in 5.5

  • Explicit global declarations are highlighted as a major change; previously globals were implicit via _ENV/_G.
  • global is now a reserved keyword, which may break code that used global() helper functions.
  • For-loop control variables are now read-only; the stated rationale is performance (avoids an implicit local x = x copy 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 _ENV or adding metamethods on _G to 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.