users: [
{
name: "Joe Schmo", // commas or semi-colons accepted, but optional
cm height: 6ft + 1in // Stof adds units and declarations as 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)
}
What is Stof?
Stof is a new, open-source interchange format (like JSON, YAML, etc.) that bridges software applications and the data they use (regardless of format). It unifies data into a single interface that is capable of handling tasks like validation, transformation, orchestration, structuring, access control, and more. Stof simplifies data handling, ensuring safe, high-quality, and accessible data that is ready for your application and users.
Why use it?
Stof is changing the way developers and data engineers work with data. Stof documents are simple, scalable, portable, and efficient. By turning data into a sandboxed and embedded runtime, Stof is capable of performing logic and transformations anywhere you need them, saving countless hours of development and headache. Stof supports multiple data formats, including JSON, YAML, TOML, and XML. It allows developers to import, export, and interact with these formats seamlessly within a unified interface.
Read the docs to learn more about what you can do with Stof.
View Docs