What Is Luau?
Part of the Introduction To Luau section of Coddy's Lua journey — lesson 1 of 73.
Luau is a programming language created at Roblox that builds on the Lua you already know by adding gradual static types. Think of it as Lua with an extra layer of safety and tooling — it powers millions of Roblox experiences and has been open source since 2021.
The key idea is that Luau is a superset of Lua 5.1. Any valid Lua 5.1 code is also valid Luau code: you can take a script you wrote in the previous sections and run it as Luau, unchanged.
What Luau adds on top is type annotations. An annotation declares what kind of data a variable should hold — a string, a number, a boolean, a table — so mistakes can be caught before your code even runs:
-- Lua (also valid Luau)
local message = "Hello World"
-- Luau with a type annotation
local message: string = "Hello World"The word gradual matters: annotations are optional. You can type one variable, one function, or a whole file — untyped Lua-style code keeps working while you add types at your own pace.
In return you get better editor tooling, more readable code, and protection against the kind of bugs that plain Lua only reveals while the program is running.
Try it yourself
This lesson doesn't include a code challenge.
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Introduction To Luau
1Getting Started with Luau
What Is Luau?Why Use Luau?Your First Luau CodeType Checking & Error ModesRecap: Introduction to Luau4Working with Functions
Typing Params & Return ValuesTyping Anonymous FunctionsFunctions Returning NothingOptional ParametersDefault Parameter ValuesVariadic FunctionsDefining Function TypesRecap: Typed Functions2Core Types
Basic Types: num, str, boolThe 'any' Type: Escape HatchThe 'unknown' TypeNil & Optional TypesType Inference in ActionExplicit Type AnnotationsRecap: Core Types Practice5Aliases, Unions, Intersections
Type Aliases for PrimitivesUnion TypesWorking with Union TypesLiteral TypesIntersection TypesCombining Type AliasesRecap: Advanced Type Combos3Typed Tables: Arrays & Maps
Typed ArraysAdding and Reading ElementsWhat is a Map Type?Declaring and Accessing MapsIterating TablesMixed-Shape TablesMulti-dimensional Typed Arraystable.unpack and VarargsRecap: Arrays and Maps