Luau (programming language)
≈ 3 min read
Names in other languages
No names in other languages are held for this entry yet.
Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.
Luau ( , ) is an open-source scripting language derived from Lua 5.1. Developed by Roblox Corporation, it serves as the primary scripting language for the Roblox platform. Luau adds gradual typing, performance improvements, and sandboxing features to the base Lua language while maintaining backward compatibility with Lua 5.1. The language was released to Roblox developers in August 20191 and became free and open-source software under an MIT License in November 2021. Since its open-source release, Luau has been adopted by several video game developers outside of Roblox, including Remedy Entertainment for Alan Wake 2, Digital Extremes for Warframe, and Giants Software for Farming Simulator 2025.
Luau ( , ) is an open-source scripting language derived from Lua 5.1. Developed by Roblox Corporation, it serves as the primary scripting language for the Roblox platform. Luau adds gradual typing, performance improvements, and sandboxing features to the base Lua language while maintaining backward compatibility with Lua 5.1. The language was released to Roblox developers in August 2019 and became free and open-source software under an MIT License in November 2021. Since its open-source release, Luau has been adopted by several video game developers outside of Roblox, including Remedy Entertainment for Alan Wake 2, Digital Extremes for Warframe, and Giants Software for Farming Simulator 2025. -- Examples of common Luau type annotations number -- integers and floats string -- text boolean -- true or false any -- variable can be set to any type local baseNumber: number = 1 -- baseNumber has the type "number" local baseNumber = 1 :: number -- 1 has been cast the type "number", overriding the inferred type The language supports two typing modes. Strict mode needs more precise type annotations and aims to catch type errors before runtime. Non-strict mode is more permissive and designed to minimize false positives when gradually adding types to extant code. These modes can be set per module using directives. Luau uses structural typing rather than nominal typing. The type checker verifies that tables contain the needed fields with correct types instead of checking class names or inheritance relationships. Luau was the first language to implement semantic subtyping for a large user base, using type normalization to check subtype relationships. Luau maintains syntactic compatibility with Lua 5.1 while adding features from other languages. The language supports augmented assignment operators ( += , -= , *= , etc.). String interpolation was added in February 2023, allowing variables to be embedded directly in string literals using backtick syntax. Luau also includes conditional expressions similar to ternary operators in other languages. local baseNumber: number = 1 -- Augmented assignment baseNumber += 1 -- Conditional expressions local isBaseNumberTwo: number = if baseNumber == 2 then true else false -- String interpolation print(`The baseNumber is {baseNumber}`) --> The baseNumber is 2 Additional features include the continue keyword to skip the remaining code in a loop's current irritation and move to the next one , and the const keyword for local variable bindings that cannot be modified once initiated. const fruits: {string} = table.freeze({"Apple", "Pear", "Banana"}) const pearFruit: string = "Pear" local foundPearFruit: boolean = false for i: number, fruit: string in fruits do if pearFruit ~= fruit then continue end print("Found pear fruit!") foundPearFruit = true break end pearFruit = "Apple" -- fail
Text derived from https://en.wikipedia.org/w/index.php?oldid=1377848473 under CC BY-SA 4.0; modifications have been made.