Lua is a lightweight, embeddable scripting language designed for extending applications. Created in Brazil, it became the dominant scripting language in game development and is widely used in embedded systems.
Origins
Researchers at PUC-Rio in Brazil created Lua in 1993. Brazil’s trade restrictions on software imports motivated developing domestic tools. Lua was designed to be embeddable in applications, providing scripting capabilities without heavy runtime overhead.
Key Features
Lua’s design prioritizes simplicity and embeddability:
- Minimal core: Small language that’s easy to learn
- Lightweight: Tiny runtime (~200KB)
- Tables: Single data structure for arrays, records, and objects
- Coroutines: Cooperative multitasking
- Metatables: Customize behavior of tables
- C API: Easy to embed in C/C++ applications
Game Development Dominance
Lua became the scripting language of choice for games:
- World of Warcraft: UI modding with Lua
- Roblox: Primary development language
- Angry Birds, Civilization: Game logic scripting
- Corona SDK, LÖVE: Game frameworks built on Lua
Broader Use
Beyond games, Lua powers:
- Nginx: Via OpenResty for high-performance web apps
- Redis: Scripting for atomic operations
- Embedded systems: IoT devices, routers
- Adobe Lightroom: Plugin system