Skip to main content

Compare · Config and schemas

Stof vs Jsonnet.

Jsonnet generates static config, then it's done. A Stof document can export the same static JSON, YAML, or TOML, and it stays live: its functions run when your app calls them.

Jsonnet

A side-effect-free configuration language that extends JSON to generate config.

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…JsonnetStof
After it runsIt produces JSON, YAML, INI, and other formats. The output is static data.It's still a document: export static JSON, YAML, or TOML, or keep it and call its functions.
The logic has to run somewhere elseSend the generated output, which is static data, or the source and its imports to generate it again.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 need to check the dataThrough assertions you write in the config.#[schema] rules on a type check any object, in the same doc as the data and the logic.
You change a ruleRe-generate the config and redeploy what reads it.Parse new fields and functions into the live doc. No build, no deploy.
UnitsNumbers and strings.A number can carry its unit, and math between units converts: 5min + 30s is 330s.

Checked December 3, 2026. Sources: jsonnet.org. Something out of date? Tell us.

What you'd still build.

On top of Jsonnet
  • A runtime for logic once the config is generated
  • Units and schemas for values
  • Changes without a redeploy
Already in Stof
  • Functions that run when your app calls them
  • Units and #[schema] checks
  • Logic that changes at runtime, with no deploy

Choose Jsonnet to generate config at build time, especially for Kubernetes manifests.

Stof vs Jsonnet, answered.

Both extend JSON. What's different?

Jsonnet runs once to produce config. Stof documents are loaded by your app and stay live: data, functions, and state, sandboxed, in your process.

Also compared.

Every comparison →

Try it in a minute.

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