Skip to main content

Compare · Building it yourself

Stof vs building it yourself.

A homegrown rules engine starts small and grows a parser, a sandbox, and a type system. Stof is that engine, already built, tested, and the same in three languages.

building it yourself

Your own rules engine, DSL, or plugin system.

Stof

Just-in-time software: data and logic together, in one document that runs anywhere, sandboxed, in Rust, JavaScript, and Python.

What happens when…

When…building it yourselfStof
A model writes the logicYou design the language, and then make it safe.Parse it as untrusted (nothing runs while it parses), seal it to what you list, and call it. Or describe the function as an intent, and a model writes it, checked by your examples.
The code loops foreverYou add limits when the first rule hangs.Every call has a time and a memory limit (2 minutes and 256 MB unless you change them), and a sealed part can have its own, like 50 ms.
Your app is TypeScript, Python, or RustYou build it again, or call one service from the others.One runtime, with packages for Rust, JavaScript and TypeScript (WebAssembly), and Python. The same doc runs in each.
The logic has to run somewhere elseYour own format, a runtime for it in each place it runs, and a way to carry state.Send the doc as text or compact binary: its data, its functions, and its current state, in one payload. The other side gives the same answer, in Rust, JavaScript, or Python.
You change a ruleOften, a change to the engine itself, and a deploy.Parse new fields and functions into the live doc. No build, no deploy.

Checked December 3, 2026. Something out of date? Tell us.

What you'd still build.

On top of building it yourself
  • A parser, an interpreter, and good error messages
  • A sandbox and limits
  • Tools: tests, a language server, an editor extension
Already in Stof
  • A runtime with errors that point at the line
  • A sandbox that is on by default, with seals for code from elsewhere
  • stof test, a language server, and a VS Code extension

Build it yourself if your rules will stay small, in one language, and never come from anyone else.

Stof vs building it yourself, answered.

Isn't a rules engine easy to write?

The first version is. Then come functions, types, errors people can read, limits, a sandbox for rules from customers or models, and the same behavior in every language you run.

Also compared.

Every comparison →

Try it in a minute.

npm i @formata/stof
pip install stof
cargo add stof