Compare · Embedded languages
Stof vs Lua.
Lua is a scripting language for your own app, and sandboxing it is your job. Stof is a document that carries its data, logic, and state over the wire, sandboxed by default, the same in Rust, JavaScript, and Python.
A small, fast scripting language embedded in apps and games through its C API.
Just-in-time software: data and logic together, in one document that runs anywhere, sandboxed, in Rust, JavaScript, and Python.
What happens when…
Checked December 3, 2026. Sources: Lua 5.4 manual · lua-users: sandboxes · lua-users: security · luac. Something out of date? Tell us.
What you'd still build.
- The sandbox: a safe environment, and no unsafe libraries
- Memory and time limits
- A way to ship the data with the logic
- A sandbox that is on by default, with seals for code from elsewhere
- Time and memory limits on every call
- Data, logic, and state in one document you can send anywhere
Choose Lua for scripting your own app or game, where speed matters most and the scripts are yours.
Stof vs Lua, answered.
Isn't Lua already safe to embed?
It's easy to embed, and you can sandbox it, but that's work you do: Lua's own community notes that a restricted environment alone doesn't limit memory or computation. Stof starts with no access and with limits on every call.
Is Stof faster than Lua?
No. Lua is one of the fastest interpreters there is. Stof is fast enough for the logic it's for (decisions that return), and it brings the sandbox, types, units, and portability with it.
Also compared.
Try it in a minute.
npm i @formata/stof
pip install stof
cargo add stof