Skip to main content

Compare · Embedded languages

Stof vs Starlark.

Starlark is a safe, deterministic configuration language that, by design, can't recurse or loop forever. Stof is a full document runtime: data, logic, types, and state that travel together and can change while they run, sandboxed with limits.

Starlark

A deterministic dialect of Python for configuration, made for Bazel.

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…StarlarkStof
A model writes the logicSafe by design: hermetic, with no access to the environment by default.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: the language doesn't allow recursion or unbounded loops.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 has to run somewhere elseSend the source, and run it where an interpreter is embedded. The values it produces stay with that program.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 livesStarlark files produce values for the program embedding them.With the logic, in the same document. Any JSON is already a Stof document.
Your app is TypeScript, Python, or RustImplementations in Java (Bazel), Go, and Rust, which differ in places.One runtime, with packages for Rust, JavaScript and TypeScript (WebAssembly), and Python. The same doc runs in each.
What it can expressNo recursion, no while loops, no exceptions, and no user-defined types.Functions, recursion, loops, types and prototypes, units, async, and errors you can catch, with limits on every call.

Checked December 3, 2026. Sources: Starlark spec · Starlark in Bazel · Starlark in Rust. Something out of date? Tell us.

What you'd still build.

On top of Starlark
  • Types, schemas, and units
  • A way to send logic with its data
  • Logic that changes while it runs
Already in Stof
  • Functions, types, units, and tests in the same doc
  • Data, logic, and state in one document you can send anywhere
  • Logic that changes at runtime, with no deploy

Choose Starlark for build and configuration files where determinism and guaranteed termination matter most.

Stof vs Starlark, answered.

Both are safe for code you didn't write. What's different?

Starlark is safe by limiting the language: no recursion or unbounded loops. Stof is safe by limiting what a document can reach and how long it can run, so the language can do more.

Also compared.

Every comparison →

Try it in a minute.

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