Skip to content

Home › Cookbook

Choosing an Entrypoint ​

Pick the narrowest Ouro entrypoint that matches your trust boundary and performance goal.

Decision Guide Inside Ouro ​

NeedUseNotes
Run one untrusted script safelyOuro.runDefaults to "balanced" preset, mode = "text" for strings, returns (ok, ...resultsOrErr).
Run many scripts under a shared policyOuro.sandboxDefine globals, libraries, and budgets once; call :fork() per user and :reset() between ticks.
Maximum warm VM speed on trusted codeOuro.load / VM.loadBytecodeRuns on the unguarded @native dispatch loop with zero wrapper overhead; isolated env by default.
Skip parser & compiler completely at runtimeVM.loadBytecode / VM.loadProtoOnly loads Ouro.VM; works well for server-compiled scripts and plugin bytecode.
Compile source or AST for storage or inspectionOuro.compile / Ouro.compileResultcompile returns (bytecode?, err?); compileResult returns structured diagnostics and BytecodeBuilder.
Parse, lint, format diagnostics, or rewrite sourceOuro.parseFlat numeric arena; :text(), :formatDiagnostics(), lossless = true + :reconstruct().
Verify or inspect bytecode without running itOuro.Bytecodeverify, deserialize, serialize, disassemble all return uniform (value?, err?) tuples.

Ouro vs Alternatives ​

Each runtime makes a different engineering trade-off:

ToolRuns on Roblox Client?Built-in Compiler?Sandbox Limits (insn / timeout / memory / pattern)?Warm Execution Speed
Roblox loadstringServer only (disabled by default; requires ServerScriptService.LoadStringEnabled)Native C++ LuauNone (runs directly in engine; infinite loops or memory bombs hit script timeout / server OOM)Native C++ engine (fastest)
OuroServer and client (pure Luau)Full Luau 0.748 O0–O2 + lossless AST + verifierBuilt-in presets (strict / balanced / trusted), per-env PCG32 RNG, non-swallowable budgets, step-budgeted patternsDual @native fast & guarded loops
FiuServer and client (pure Luau)No (requires external bytecode compiler)Manual hook/env wiringPure-Luau interpreter
LuauCeptionServer and client (WASM compiled to Luau)Embedded C++ Luau 0.654 via WASMManual C API wiring (lua_State); pcall unwinding throws in WASM C++ exceptionsEmscripten WASM VM in Luau

When Not to Use Ouro ​

  • Trusted server-only code where native speed is required: If you control the code and don't need sandboxing, deploy normal Luau ModuleScripts instead of an embedded VM.
  • Full static type checking: Ouro parses all Luau 0.748 type annotations and .d.luau declarations, and emits compiler typeinfo, but does not include Luau's type checker (Luau.Analysis).
  • Experimental v100 class execution: Ouro parses, compiles, and decodes experimental class syntax/bytecode (v100), while the VM rejects v100 execution until upstream stabilizes class runtime semantics.