Course
Lua Scripting & Embedding
A practitioner's guide to Lua as a glue language — embedding it safely in C applications, scripting games and Roblox responsibly, and running high-performance Lua inside OpenResty and nginx.
Reviews
Enrolled members can rate this course.
No reviews yet.
Embedding Lua in Host Applications
Learn the Lua mental model, the C API stack contract, and the sandboxing boundaries that keep host applications in control.
- 01Why Lua Became the Glue LanguageUnderstand the embedding bargain: a small dynamic language gives product logic flexibility while the host retains authority over data, capabilities, and failure.21mOpen
- 02The lua_State, the Stack, and the C API ContractLearn the stack discipline behind lua_pcall, arguments, returns, references, and cleanup so embedded Lua calls stop corrupting state in production.27mOpen
- 03Sandboxing, Capabilities, and Host BoundariesBuild a least-privilege Lua environment using custom globals, controlled libraries, resource limits, allocation policy, and narrow host capabilities.28mOpen
Game Scripting and Roblox
Use Lua for data-driven gameplay, coroutines, events, and server-authoritative Roblox systems without letting scripts own the game.
- 01Data-Driven Gameplay Without Losing ControlUse Lua to compose enemies, items, quests, and abilities from data while keeping invariants, validation, and ownership in the engine.23mOpen
- 02Coroutines, Events, and Frame-Time DisciplineModel scripted sequencing with Lua coroutines and event subscriptions while respecting cooperative execution, cleanup, and frame budget constraints.25mOpen
- 03Roblox and Luau: Server Authority in a Scripting WorldDesign Roblox systems where clients present intent, server Scripts validate and mutate authoritative state, and RemoteEvents never become trust boundaries.29mOpen
OpenResty and Production Lua
Run Lua inside nginx correctly, understand LuaJIT performance and FFI behavior, and write modules that can be tested and operated.
- 01OpenResty and the nginx Request LifecyclePlace Lua in the correct nginx phase, use cosockets without blocking workers, and avoid the configuration mistakes that make OpenResty unreliable.28mOpen
- 02LuaJIT Performance, FFI, and Memory BehaviorWrite hot-path Lua that cooperates with LuaJIT: reduce allocation churn, understand FFI cdata, localize lookups, and measure before optimizing.26mOpen
- 03Writing Clean, Testable, Operable LuaStructure Lua modules for clarity, isolate dependencies, test behavior with real harnesses, and operate scripts with versioning, linting, and observability.24mOpen