TechnologyScripting language

Lua

Lightweight, embeddable scripting language created in Brazil in 1993, widely used to script video games and extend applications.

Lua is a small, fast scripting language designed to be embedded inside other programs. Its interpreter is written in portable C and is compact enough to fit in applications, games and devices with limited resources. The language has a simple syntax and a single flexible data structure, the table, which serves as array, dictionary, object and module. Functions are first-class values, memory is managed by garbage collection, and a clean C interface lets host programs expose their own functions to Lua scripts.

Roberto Ierusalimschy, Luiz Henrique de Figueiredo and Waldemar Celes created Lua in 1993 at the Pontifical Catholic University of Rio de Janeiro, where the language is still developed. Its name means moon in Portuguese. Lua is distributed under the MIT License. LuaJIT, an independent implementation by Mike Pall, adds a high-performance just-in-time compiler, and Roblox developed Luau, a derivative with gradual typing, for its platform.

Lua is one of the most common languages for scripting games and modding: World of Warcraft uses it for interface add-ons, and platforms such as Luanti and Roblox build on it or its derivatives. Beyond games it configures the Neovim editor, extends the Nmap scanner and scripts databases such as Redis. Its minimalism keeps it easy to embed and learn, though its small standard library means many features come from the host application.

Key points

  • Lua is designed to be embedded in other programs and has a small, portable C implementation.
  • Tables are Lua's single data structure, used as arrays, dictionaries and objects.
  • It was created in 1993 at the Pontifical Catholic University of Rio de Janeiro.
  • World of Warcraft add-ons, Neovim configuration and Nmap scripts all use Lua.

Related entries

Glossary term

Game Engine

Video GamesProgramming

Software framework that provides the core systems for building games, such as rendering, physics, audio, input, scripting and editing tools.

Glossary term

Modding

Video GamesFOSS

Practice of players and fans modifying video games to change or add content, fix problems or create entirely different experiences.

Technology

Luanti

Video GamesFOSS

Free and open-source voxel game engine, known as Minetest until 2024, on which many block-based games and mods are built in Lua.

Technology

Nmap

CybersecurityFOSS

Free and open-source network scanner used by administrators and authorized security testers to discover hosts, services and exposures on networks.

Glossary term

Interpreter

Programming

Program that executes instructions written in a programming language directly, statement by statement, without first producing a standalone executable.

Technology

C

ProgrammingHardware

General-purpose programming language created by Dennis Ritchie at Bell Labs in the early 1970s, foundational for operating systems and embedded software.

Glossary term

Technique that compiles code into native machine instructions while a program is running, combining interpreter flexibility with compiled speed.

Technology

Vim

ProgrammingFOSS

Free, highly configurable modal text editor created by Bram Moolenaar, descended from vi and available on nearly every Unix-like system.

Referenced by

Other entries that discuss or point to Lua.