100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Programming

Lua

IntermediateLanguage6K learners

Lua is a lightweight, fast, and embeddable scripting language designed to be integrated into larger applications written in C and other languages.

#Lua#Programming#Language#Intermediate#Redis#Nginx#Python#SoftwareDevelopment#Glossary#SkillVeris

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

Use Cases

Scripting server-side logic in Redis for atomic, multi-command operations
Extending web servers like Nginx, via OpenResty, with custom request handling
Writing add-ons and mods for games such as World of Warcraft and Roblox
Configuration scripting inside larger applications and embedded systems
Game engine scripting, including gameplay logic in commercial engines
Building lightweight, sandboxed plugin systems for desktop or server software

Frequently Asked Questions