Library:Luau
Appearance
| On this wiki | Facts · Code · Notes · Topics |
|---|
Luau is Roblox's open-source (MIT) Lua 5.1 derivative with gradual typing, a register-based bytecode compiler and VM; scripts run as serialized bytecode whose first byte is a version number.
Overview
Luau (github.com/luau-lang/luau, MIT) is the language and VM used by Roblox and embedded elsewhere. Source files are .luau or .lua; the compiler (Compiler/) emits bytecode that luau_load in VM/src/lvmload.cpp loads. The bytecode definition is Common/include/Luau/Bytecode.h. See Format:Luau bytecode for the layout.
Identification
- Bytecode has no
\x1bLuasignature; do not look for it. Check the first byte (a version 3 to 14) and the second (type version 1 to 3). Compare Format:Lua bytecode and Format:LuaJIT bytecode, which start with 0x1B. - The loader error strings
bytecode version mismatch (expected [andbytecode type version mismatchidentify the library in a binary (read in lvmload.cpp). - Luau has a buffer type and a vector type (see
LBC_TYPE_*in Bytecode.h); Unverified: vector as a native type is a quick language-level hint.
Related
Library:Lua, Library:LuaJIT, Technique:Choosing a decompiler.
Code & repositories
- https://github.com/luau-lang/luau @
9d7748a4f324213a18cb8283fa2a77c330225fa0· license: MIT
Luau source (MIT): VM/src/lvmload.cpp is the bytecode loader, Common/include/Luau/Bytecode.h the opcode and tag definitions with the version history.
Tested on: source read, not run · checked 2026-10-19; last activity 2026-10-16; Note: the latest release ships binaries; the wiki links only the source, never the binaries