Skip to main content

Compare · Expressions and rules

Stof vs CEL.

CEL evaluates a single expression against variables your app declares, safely and fast. Stof is a whole document: data, functions, types, and state, in the same kind of sandbox, sent as one payload.

CEL

Google's Common Expression Language: one expression, fast and safe, not Turing complete.

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…CELStof
A model writes the logicSafe: CEL was designed so user code is safe to run.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 foreverIt can't: CEL evaluates in linear time and isn't Turing complete.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.
The logic outgrows one expressionA CEL program is a single expression. Functions come from the app embedding it.Write functions, helpers, and types in the doc itself, and call your app's functions too.
The logic has to run somewhere elseSend the expression as text, or as a checked expression in protobuf. The variables and functions it uses are declared by the app on each side.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.
Where the data livesPassed in by your app as variables it declares.With the logic, in the same document. Any JSON is already a Stof document.
Your app is TypeScript, Python, or RustOfficial implementations in Go, Java, and C++, plus community ones.One runtime, with packages for Rust, JavaScript and TypeScript (WebAssembly), and Python. The same doc runs in each.

Checked December 3, 2026. Sources: cel-go · CEL spec · CEL codelab · cel-go package docs. Something out of date? Tell us.

What you'd still build.

On top of CEL
  • Functions and helpers beyond one expression
  • A place for the data and state
  • Tests next to the rules
Already in Stof
  • Functions, types, units, and tests in the same doc
  • Data, logic, and state in one document you can send anywhere
  • Tests (#[test]) in the doc, run with stof test

Choose CEL for a single condition or filter that must be fast and can't ever loop, like an authorization check.

Stof vs CEL, answered.

CEL is safe because it's small. Is Stof as safe?

Safe a different way. CEL can't loop; Stof can, so every call has a time and memory limit, and a document sees only itself and what you hand it.

Also compared.

Every comparison →

Try it in a minute.

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