Stof: The Data Runtime for Context that Travels

website·Indexed 32 days ago

https://stof.dev

Stof is a data runtime that treats documents as graphs of named nodes rather than static trees of values. A strict superset of JSON, Stof allows data and logic to coexist in the same document, enabling documents to transform themselves and run unmodified across different targets. It is sandboxed by default and uses an async-first model where units of work are treated as processes.

Tokens
52.4K
Snippets
487
Records
557
Agent score
63%

What's inside Stof

  1. Overview of the Stof Data Runtime

    Stof is a data runtime where documents (a superset of JSON) can contain executable logic. It runs within a Rust-based WASM sandbox, ensuring that the data cannot access the filesystem, network, or host memory unless explicitly permitted via the doc.lib() bridge. This allows services to share actual logic and capabilities as data, which the consumer can parse and execute immediately without requiring SDKs or redeployments.
  2. Overview of Stof Data Runtime Architecture

    Stof is a data runtime designed for complex documents where structure and behavior must travel together. Its core architecture represents data as a flat graph of nodes and data components connected by pointers rather than nested copies. This design ensures that moving or transforming parts of a document remains computationally inexpensive.
  3. Overview of Stof as a Data Runtime

    Stof is a data runtime designed to solve the problem of 'schema drift' and the limitations of inert interchange formats (like JSON or YAML). Unlike traditional formats that require out-of-band validation or custom DSLs (e.g., HCL or OpenAPI), Stof provides a general-purpose runtime that bundles data and logic together. Key characteristics include:

    • Sandboxed by Default: Ensures that logic arriving from external or untrusted sources is safe to execute.
    • Portable: Documents behave identically across different environments, including native execution, WebAssembly, or Python hosts.
    • Extensible: Documents can dynamically parse new fields, types, and functions during execution, removing the need for redeployments to change data shapes.
  4. Overview of Stof Data Runtime

    Stof is a superset of JSON that embeds functions, types, unit conversions, and asynchronous execution directly into the data format. It acts as a glue layer capable of parsing multiple interchange formats (JSON, YAML, TOML, etc.) into a single document, allowing developers to attach logic and validation to data regardless of its source format.
  5. Overview of Stof's domain-agnostic data runtime

    Stof is a data runtime designed to create documents that carry their own data, logic, and boundaries. It utilizes a graph-based model with sandboxing and portability, ensuring that the document runs consistently regardless of where it is deployed. This architecture allows for self-transformation and domain-agnostic application across various use cases.
  6. Unify configuration from multiple formats using Stof

    Stof treats configuration formats (such as YAML deploy manifests, TOML tool configs, and JSON API responses) as import details rather than boundaries. Instead of converting all data to a single format upfront or writing multiple downstream parsers, Stof allows data from various formats to land in the same graph, ensuring it is read consistently regardless of the original source format.
  7. Understand the Stof Data Runtime concept

    Stof is defined as a data runtime rather than a format, language, or database. Unlike standard data formats (JSON, YAML, TOML) which are inert snapshots, a Stof document is a self-contained unit that combines data with logic. It is a strict superset of JSON, meaning it maintains structural data compatibility while behaving more like an object with methods than a static table or file. It does not require a separate compilation step, standalone executable, or external query engine/storage layer.
  8. Use the Stof HTTP Network Library (Http)

    The Http library provides network capabilities within Stof. To use it, the http feature flag must be enabled. The library is designed to bridge naturally with TypeScript/JavaScript Promises when hosted in a TypeScript environment. Requests made via Http.fetch are executed on a background thread pool, preventing the calling process from blocking. Using await with Http.fetch allows multiple network requests to run in parallel.
  9. Understand Stof runtime portability

    Stof allows the same documents and functions to run unmodified across different targets without requiring host-specific dialects. This portability is ensured by a sandboxing model. Supported targets include: native execution via the Rust crate, browser or edge functions via WebAssembly, and embedded environments using Python or TypeScript bindings.
  10. Understand the Stof Data Runtime concept

    Stof is a data runtime and a superset of JSON. Unlike traditional data formats where data is an inert value interpreted by an external program, a data runtime allows documents to carry their own logic—including fields, types, and functions—within a sandboxed and portable environment. This enables data to validate itself, transform itself, and execute actions regardless of the host embedding it.