Tooling#

Lua keeps its core distribution minimal; most tooling comes from a small set of well-known third-party projects.

Interpreters#

  • Lua, reference implementation in C.

  • LuaJIT, tracing JIT, compatible with Lua 5.1.

  • Luvit, Node-style runtime built on libuv.

$ lua -v
$ lua script.lua

Package Manager#

  • LuaRocks, the de-facto package manager.

$ luarocks install penlight
$ luarocks install --local busted

Linters#

$ luacheck src/

Formatter#

$ stylua src/

Testing#

$ busted spec/

Debugging#

  • MobDebug, remote debugger.

  • ZeroBrane Studio, IDE with built-in debugger.

  • Built-in: debug.traceback(), debug.sethook, debug.getinfo.

Documentation#

  • LDoc, doc generator.

$ ldoc src/

Editor Support#

  • lua-language-server, the de-facto LSP.

  • Comes with type annotations via comment syntax (---@param).

Embedded Lua#

Lua is often embedded in another program. Common hosts.

  • Game engines (LÖVE, Defold, Roblox, World of Warcraft).

  • Nginx / OpenResty.

  • Neovim (init.lua configuration and plugins).

  • Redis (server-side scripting).