Skip to content

Course

Lua Scripting & Embedding

Lua the way host applications actually use it — a small language core, tables and metatables, coroutines, safe embedding through the C API, and the production patterns behind game and infrastructure scripting.

9 lessons

Course Q&A

Reviews

Enrolled members can rate this course.

No reviews yet.

Language Core

The small semantic core: values, tables, metatables, functions, and coroutines.

  1. 01The Lua Mental Model: Small Language, Sharp EdgesWhy Lua stays tiny, what that buys embedders, and the few semantics — tables, truthiness, varargs, and 1-based indexing — that decide whether scripts behave.20mOpen
  2. 02Tables and Metatables: Lua's Object System in Plain SightHow __index, __newindex, operators, and prototype chains turn one table type into objects, defaults, validation, and controlled extension points.24mOpen
  3. 03Coroutines: Cooperative Control Flow Without Async NoiseLua coroutines as resumable computation — how yield/resume really works, why they fit scripting, and where they fail under host reentrancy.22mOpen

Embedding and Integration

How applications host Lua safely, expose native capabilities, and manage the boundary.

  1. 01Embedding Lua: Designing the Host-Script BoundaryThe architectural decisions that matter before writing binding code: state ownership, capabilities, lifetime rules, error handling, and what scripts are allowed to know.21mOpen
  2. 02The Lua C API: Stacks, Calls, and Lifetime RulesHow host code actually drives Lua: lua_State, the stack discipline, protected calls, references, and the memory mistakes that create impossible crashes.28mOpen
  3. 03Sandboxing and Performance: Letting Scripts Run Without Owning YouHow to restrict libraries, isolate environments, bound execution, and measure Lua hot paths before they become frame spikes or request latency.26mOpen

Real-World Tooling

The operational patterns behind Lua in games, Redis, OpenResty, Neovim, and production systems.

  1. 01Lua in Game Systems: Content Code Without Engine RecompilesWhy game engines keep choosing Lua, how gameplay scripts are structured around ticks and events, and the production constraints behind modding support.23mOpen
  2. 02Lua in Infrastructure: Redis, OpenResty, Neovim, and FriendsHow Lua appears inside production infrastructure, what each host environment guarantees, and why the same language behaves differently inside Redis, Nginx, and an editor.25mOpen
  3. 03Testing, Debugging, and Operating Embedded LuaHow to build a feedback loop for scripts: isolated tests, useful errors, tracing hooks, versioning, hot reload, and production visibility.24mOpen