stof-0.4.1 has been yanked.
Visit the last successful build: stof-0.9.6

Stof is a simple data runtime for all of your stuff. It unifies data handling and makes working with data much more enjoyable.

Why

Stof drastically decreases the amount of application code it takes to manipulate data by moving logic into the data that needs manipulating (typically done the other way around), creating a standard interface that can be used for cheaper and higher-quality access, while improving security, developer experience, and governance.

Getting Started

CLI

CLI is a standalone way to use Stof outside of an embedded environment.

cargo install stof-cli

Rust

The Stof Rust Crate is the most fully-featured way to embed and work with Stof. However, we are adding as many languages as possible to this list.

cargo add stof

TypeScript (JSR)

It is currently possible to use Stof from the browser and in JavaScript host environments through WebAssembly. In this context, Stof is not yet fully featured. Stof JSR

Example

Note: Stof is also a superset of JSON

users: [
    {
        name: "Joe Schmo",       // commas or semi-colons accepted, but optional
        cm height: 6ft + 1in     // Stof adds units and declarations are expressions
        age: +32;                // trailing commas or semi-colons are okay
    },                           // trailing commas in arrays are okay
]

fn getJoe(): obj {               // Stof adds data types (casting, etc..)
    for (user in self.users) {
        if (user.name.toLower().contains("joe")) return user;
    }
    return null;
}

#[main]
fn main() {
    let joe = self.getJoe();
    pln(stringify(joe, 'toml')); // any format loaded into the doc (parse too)
}
> stof run example.stof

age = 32

height = 185.42

name = "Joe Schmo"

Why Use Stof?

Use Stof for just about any data interchange use-case. It's particularly helpful for data unification and sending APIs (logic) over the wire (and combining APIs dynamically).

  1. Data Unification
    • Use different types of data together at once (PDFs, JSON, YAML, XML, Images, DOCX, etc).
  2. Remote Execution
    • Send Stof over networks as a lightweight and sandboxed way to execute logic remotely.
  3. Data Validation
    • Use Stofs type system to quickly and easily filter/validate data according to your needs.
  4. Data Transformation & Connectors
    • Connect data to your application through Stof for easy restructuring & access.

Contributing

Theres a lot to do, so please jump in and consider supporting the project.

License

Apache 2.0. See LICENSE for details.