Learn Lua
Structured lessons from the basics up — follow the path below in order, at your own pace.
-
1
Level 1 — Beginner Beginner 27 lessons
Start here if you have never written a line of Lua before. No programming experience is required — work through these lessons in order, sinc...
Lessons in this module
What Is Lua? Why Learn Lua? What Can You Do With Lua? Installing Lua Setting Up Your Environment Your First Program How Lua Code Runs Variables and local Data Types nil and Booleans Numbers and Math Strings String Functions Operators if Statements while and repeat Loops Numeric for Loops Tables: The One Data Structure Arrays Dictionaries and Records Iterating with pairs and ipairs The Table Library Functions Multiple Returns and Default Arguments Scope and Blocks Input and Command-Line Arguments Comments and Style -
2
Beginner Projects Beginner 1 lesson
Build these on your own using what you learned in Level 1. Each one uses variables, tables, loops, functions, and string handling. 1. Number...
-
3
Level 2 — Intermediate Intermediate 17 lessons
These lessons cover closures, variadic functions, string patterns, advanced tables, metatables and metamethods, object oriented programming,...
Lessons in this module
Closures Variadic Functions String Patterns Advanced Tables Metatables and Metamethods __index and __newindex Object-Oriented Programming Inheritance Modules and require Error Handling Files and I/O Iterators Coroutines Coroutine Schedulers Dates, Times, and the os Library Serialization and Data Files Functional Style -
4
Intermediate Projects Intermediate 1 lesson
Build these using closures, metatables, OOP, modules, error handling, files, and coroutines from Level 2. 1. Inventory System Write an Item...
-
5
Level 3 — Advanced Advanced 14 lessons
These lessons cover environments and sandboxing, weak tables and garbage collection, performance, LuaJIT and Lua versions, embedding Lua in...
Lessons in this module
Environments and Sandboxing Weak Tables and Garbage Collection Performance Lua Versions, LuaJIT, and Luau Embedding Lua in C Writing C Modules Game Development with LÖVE Roblox and Luau Configuring and Extending Neovim Lua in Redis and Nginx LuaRocks and Project Structure Testing and Debugging Building Domain-Specific Languages Best Practices for Production Lua -
6
Advanced Projects Advanced 1 lesson
Build these using environments, performance techniques, embedding, LÖVE, Neovim, and testing from Level 3. 1. A LÖVE Game Build a small arca...
-
7
What You Should Know Now — and What's Next 1 lesson
What You Should Know Now Variables, types, strings, and operators — and why only nil and false are falsy Tables as arrays, dictionaries, and...