Lua is so underrated

Lua’s small, portable runtime and clean C embedding API earn praise for use as an embedded scripting language in games, tools, and niche systems, with some highlighting powerful extensions like LuaJIT, Terra, and Roblox’s Luau. Critics counter that the language itself has sharp edges—1‑based, nil‑terminated tables, weak standard library, globals by default, and a stack‑oriented C API that’s easy to misuse—and that JavaScript or WebAssembly now offer better ecosystems and familiarity for most users. The overall view is that Lua excels in its original niche of lightweight, embeddable scripting but is less compelling as a general‑purpose or large‑scale application language.

Lua as Embedded / Scripting Language

  • Widely used as an embedded scripting language in games, editors, calculators, Redis, HAProxy, Neovim, OBS, etc.
  • Praised for tiny runtime, easy C/C++ integration, and suitability for constrained environments (microcontrollers, old consoles, small binaries).
  • Several report very productive experiences building game logic, GUIs, automation, and scientific tools; quick iteration is a key benefit.
  • Others find embedding painful: stack manipulation is error‑prone, memory leaks are easy, and the API feels low‑level and “assembly‑like” unless wrapped.

Language Design & Ergonomics

  • Fans like the small, orthogonal core: tables + closures + coroutines; easy to make DSLs and custom OO patterns.
  • Common complaints:
    • 1‑based indexing; nil‑terminated “arrays”; tables conflating arrays, maps, and objects; footguns with nil and #.
    • Globals by default; lack of continue, switch, structured error handling (try/catch); minimal standard library.
  • Some see this minimalism as elegant and empowering; others see it as “hostile” and requiring each project to reinvent basic abstractions.

Performance & Implementation

  • Vanilla Lua is generally fast for a high‑level language but slower than modern V8 in benchmarks; newer Lua versions may be slower than older ones.
  • LuaJIT is repeatedly described as extremely fast, with an exceptional FFI that makes C interop easy, but it’s less portable and not evolving quickly.
  • Several note that for embedded scripting, “fast enough” plus small footprint matters more than beating JS JITs.

Tooling, Types, and Ecosystem

  • Lack of batteries and smaller ecosystem vs Python/JS is a recurring concern.
  • LuaLS + LuaCATS annotations give LSP/type‑like support; some use TypeScript‑to‑Lua to get types and nicer tooling.
  • Dynamic typing and weak invariants are criticized; others argue tests and discipline suffice.

Alternatives and Successors

  • JavaScript (QuickJS, Duktape, XS) is frequently proposed as a better default embedded language due to ubiquity and ecosystem.
  • Luau (Roblox), Fennel, Janet, FixScript, Terra, and WebAssembly‑based plugin models are discussed as directions with better typing, performance, or ergonomics.
  • Some argue Lua is “correctly rated” or even overrated: unbeatable for embeddability, but rarely the best general‑purpose choice.