Lua Fundamentals
Lua is a small, fast scripting language designed to be embedded inside larger applications, from video games to network servers. Instead of running programs on its own, it usually acts as the configuration and extension layer that a host program calls into.
itProgramming languages | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic - Lua Fundamentals
Lua Fundamentals is the subject of this course. Lua is a dynamically typed scripting language designed at PUC-Rio, the Pontifical Catholic University of Rio de Janeiro, with development starting in 1993. It is small, fast, and built from the start to be embedded inside a host application written in C or another language.
The useful unit of work is a closed loop: clarify the goal and boundaries, gather the inputs the practice requires, make the decision or change, record evidence, and return with owners for the next cycle. Skipping any link leaves teams busy without durable results.
Tooling supports the loop; it does not replace it. Choose tools after the boundary and evidence model are clear. Comparing products without that model produces feature matrices that do not change how the work runs.
Common failure modes include undefined ownership, metrics that count activity instead of outcomes, and irreversible steps taken without a review path. Treat those as design defects in the practice, not as individual heroics to compensate later.
Operators should be able to explain which signals would change a decision this week. If no signal can change the plan, the practice has become ritual. Keep the feedback path short enough that evidence still influences the next cycle.
Name the owners for each stage of the loop before the work scales. Unowned stages become permanent exceptions. Record decisions with enough context that a future operator can tell why a tradeoff was accepted. Prefer fewer, sharper metrics that change behavior over broad dashboards that only describe activity after the fact.
Read the Intro for the core model. Use the Cheatsheet when you need the operating map. Updates tracks official guidance when this course configures an update source; otherwise the practice is settled without a live feed.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://www.lua.org/about.html
Supports
- Lua is a small, efficient, lightweight, embeddable scripting language
- Origin at PUC-Rio (Pontifical Catholic University of Rio de Janeiro), development began 1993
- Supports procedural, object-oriented, functional, data-driven, and data-description styles
- Distributed under the MIT license
- Bytecode compiled, register-based virtual machine
- https://www.lua.org/manual/5.4/manual.html
Supports
- Eight basic types - nil, boolean, number, string, function, userdata, thread, table
- number has integer and float subtypes (since Lua 5.3)
- Tables are the sole built-in data-structuring mechanism, used as arrays, records, sets, and objects
- Global variables are fields of the global environment table _G; local declares block scope
- Generic for loop calls an iterator function until it returns nil; pairs and ipairs
- Functions are first-class values, support multiple return values and varargs (...)
- Metatables attached with setmetatable define metamethods (__index, __newindex, __add, __eq, __call, __tostring, __len)
- No built-in class keyword - object patterns built from tables plus __index
- error raises and never returns; pcall/xpcall run a call in protected mode and return a status flag
- Coroutines only suspend via explicit coroutine.yield, never preempted; coroutine.create/resume/status/wrap
- require checks package.loaded before loading, then searches package.path; module convention returns a table
- string library pattern matching (not regular expressions): string.find, string.match, string.gmatch, string.gsub, string.format; character classes %a %d %s %w
- table library: table.insert, table.remove, table.concat, table.sort
- Arithmetic operators including / (always float) and // (floor division)
- https://www.lua.org/versions.html
Supports
- Lua version history - 5.0 (2003), 5.1 (2006), 5.2 (2011), 5.3 (2015), 5.4 (2020), 5.5 (2025)
- https://www.lua.org/download.html
Supports
- Current stable release is Lua 5.5.0, released 2025-12-15
- https://www.lua.org/uses.html
Supports
- Lua is used in many products and projects, including well-known games and embedded/extensible applications
- https://luajit.org/luajit.html
Supports
- LuaJIT is a Just-In-Time compiler for Lua
- LuaJIT supports the Lua 5.1 API and ABI
- https://luarocks.org/
Supports
- LuaRocks is the package manager for Lua modules, installed as self-contained packages called rocks
- https://www.lua.org/pil/contents.html
Supports
- Programming in Lua (first edition) is freely available online for personal use, by Roberto Ierusalimschy
- https://github.com/LewisJEllis/awesome-lua
Supports
- Curated ecosystem entries - LuaJIT, LuaRocks, busted, OpenResty, LOVE, AwesomeWM, Hammerspoon
