Getting Started
Install Ouro in Roblox or standalone Luau and parse, compile, or sandbox your first chunk.
Installation
Wally
Add Ouro to [dependencies] in wally.toml and run wally install:
toml
[dependencies]
Ouro = "kohltastrophe/ouro@0.1.0"Ouro installs as a shared dependency in Packages, available on both the Roblox server and client.
pesde
Install Ouro with the pesde CLI:
sh
pesde add kohltastrophe/ouroOr add it directly to [dependencies] in pesde.toml and run pesde install:
toml
[dependencies]
ouro = { name = "kohltastrophe/ouro", version = "^0.1.0" }Ouro publishes both roblox and luau targets under the same version, so pesde add picks the matching build automatically.
GitHub Releases (.rbxm)
- Download
Ouro.rbxmorOuro-<version>-package.zip(withSHA256SUMS) from GitHub Releases. - Drop
Ouro.rbxminto Roblox Studio underReplicatedStorage.
Rojo or Standalone Luau
- Rojo: Build a
.rbxmwithrojo build default.project.json --output build/Ouro.rbxmor syncsrc/directly intoReplicatedStorage. - Standalone Luau: Require the repository root directly (
local Ouro = require("./ouro")). - Git subtree (
distbranch): Pull the runtime-onlydistbranch fordefault.project.json,init.luau,src/,LICENSE.md, andUPSTREAM.json:
sh
git subtree add --prefix=Packages/Ouro https://github.com/kohltastrophe/ouro.git dist --squashFirst Steps
1. Parse and Reconstruct Source
luau
--!strict
local Ouro = require("./ouro")
local source = "-- keep comments\nlocal x: number = 20 + 22\nreturn x"
local parsed = Ouro.parse(source, {
profile = "studio",
lossless = true,
})
if parsed.status == "ok" then
print(parsed:kindName(parsed.root)) -- "AstStatBlock"
assert(parsed:reconstruct() == source)
end2. Compile to Luau Bytecode
luau
local compiled = Ouro.compileResult("local a, b = ...\nreturn a * b + 2", {
optimizationLevel = 2,
dumpFlags = Ouro.Bytecode.DumpFlags.Code,
})
if compiled.status == "ok" and compiled.builder then
print(compiled.builder:dumpEverything())
end3. Execute Untrusted Code in a Sandbox
luau
local baseEnv = Ouro.VM.createEnvironment({ answer = 40 }, { readOnly = true })
local env = Ouro.VM.sandbox(baseEnv)
local fn, err = Ouro.load("return answer + bonus", {
name = "=example",
env = env,
instructionLimit = 100_000,
callLimit = 64,
timeout = 1,
safeEnv = true,
resourceLimits = {
maxStringLength = 65_536,
maxTableSize = 10_000,
},
getGlobal = function(name, currentEnv)
if name == "bonus" then
return 2
end
return currentEnv[name]
end,
})
if fn then
print(fn()) -- 42
else
warn(err)
endNext Steps
- Parsing & AST: Configure parser profiles, lossless reconstruction, arena visitors, and yielding checkpoints.
- Compiling & Bytecode: Tune optimization levels, custom builtin callbacks, encoders, and disassembly.
- Sandboxed VM: Configure isolated environments, instruction and time caps, global hooks, and debugger callbacks.
- Benchmarks: Compare Ouro against Fiu and LuauCeption across VM execution, O2 compilation, and cold startup.