Lua
Lua is a lightweight, fast, and embeddable scripting language designed to be integrated into larger applications written in C and other languages.
Definition
Lua is a lightweight, fast, and embeddable scripting language designed to be integrated into larger applications written in C and other languages.
Overview
Lua was created in 1993 at PUC-Rio in Brazil by Roberto Ierusalimschy, Waldemar Celes, and Luiz Henrique de Figueiredo, originally to give a data-processing application a flexible configuration and scripting layer. Its small size, simple C API, and permissive license made it an easy language for other software to embed. Lua is dynamically typed, garbage-collected, and built around a small set of core concepts—tables as its single, flexible data structure, first-class functions, and coroutines for cooperative multitasking. Its reference implementation is a small, portable C interpreter, which is why it's so often chosen as an embedded scripting layer rather than used as a general standalone language, and it's often taught alongside Python as a second, embeddable scripting language. It's widely embedded inside other tools: Redis uses Lua for atomic server-side scripting, Nginx supports Lua scripting through modules like OpenResty, and it's the primary scripting language for World of Warcraft add-ons and for game engines and platforms such as Roblox and LÖVE.
Key Features
- Minimal, portable C implementation that's easy to embed in other software
- Tables as a single, flexible data structure used for arrays, objects, and modules
- First-class functions and closures
- Coroutines for lightweight cooperative multitasking
- Small standard library, kept intentionally minimal for embeddability
- Fast interpreter performance, especially via the LuaJIT just-in-time compiler