githubEdit

🚀Stof: Data + Logic

Data and logic have always been separate. That makes things hard. Stof puts them together.

A portable document format where validation, functions, and behavior live alongside the data they belong to, in one document, across any service, language, or runtime.


Why Stof?

1. Data that validates and computes itself

The problem: Your config file, your schema, and the application code that interprets them are three separate things that all have to stay in sync. When one changes, the others silently break.

With Stof: Validation rules and computed values live directly in the data, defined once, enforced everywhere, no separate schema file required.

#[type]
Server: {
    #[schema((target_val: int): bool => target_val > 1024 && target_val <= 65536)]
    int port: 8080

    #[schema((target_val: str): bool => target_val != "")]
    str! address: "localhost"

    #[schema((target_val: MiB): bool => target_val > 2MB)]
    MiB memory: 500GiB

    fn url() -> str {
        `https://${self.address}:${self.port}`
    }
}

#[main]
fn main() {
    const server = new Server { port: 4000, address: "my-server.com" };
    assert(<Server>.schemafy(server));
    pln(server.url()); // https://my-server.com:4000
}

2. Prompts, Context, and AI workflows as maintainable data

The problem: Prompts are strings. Tool definitions are JSON blobs. Model configs live in application code. As your AI system grows, keeping all of it in sync becomes its own engineering problem.

With Stof: Prompts, instructions, and model behavior are structured, composable, and version-controlled as data, not scattered across your codebase as strings.

3. Logic that travels with your data across any boundary

The problem: Every time data crosses a service boundary, the logic that operates on it has to be re-implemented, re-validated, or trusted blindly on the other side. The data arrives, but the behavior stays behind.

With Stof: A document carries its own enforcement rules, validation, and behavior; parse it anywhere, run it anywhere, no dependencies required.

circle-info

Built with Stof: Limitrarrow-up-right is an open source pricing and enforcement engine. The entire policy - plans, credits, limits, validation logic - lives in a single Stof document.


Embedded Anywhere

Stof is written in Rust with a slim WASM runtime. Use it from TypeScript, Python, or Rust today.

TypeScript / JavaScript

Rust

Python


Built with Stof

Company
Description

Limitrarrow-up-right - Monetize your AI & SaaS.

Virnika

Virnikaarrow-up-right - AI Agents for Restaurants.

Katerarrow-up-right - Comprehensive Data & Analytics.

Your logo here


Get Involved

Last updated