๐Welcome
Introduction to Stof.
Stof is the future for how data is utilized between systems. The way data is passed around today is how code must now behave, enabling a decentralized and federated approach to specialized data interfaces and manipulation.
Not only does Stof turn code into data that can safely manipulate itself as it travels between systems, but Stof puts all sorts of data together into a simple, efficient, and unified interface that can be embedded anywhere.
Changing how data is represented and moved solves many fundamental problems for system design, currently requiring language-specific SDKs, fragile application code, and countless development hours to approach.
Large datasets are expensive to work with over a network connection, requiring us to move the logic to the data rather than the more traditional approach of moving small amounts of data to a program. Programs are becoming more specialized and data is getting exponentially bigger.
It is much less secure to send lots of sensitive data over a network instead of the logic/instructions for how one intends to use the data, minimizing the amount of data that leaves a server.
Instead of mere metadata, Stof enables meta-code, that can dynamically validate, unify, transform, control access, etc. per field, system, and user. Some metaprogramming, but for data and code as data.
Orchestrating many services often requires a centralized application that knows how to talk with each service, and how they differ in format, schema, etc. Stof solves this at the data layer, removing the need for a special app in the middle, and providing the scalability needed to meet modern inter-service demands.
Data interchange formats (JSON, YAML, etc.) are largely isomorphic, but independent from one another, relying on each programming language and developer to individually parse into a useful state and use. This is too expensive at scale and isn't fun or enabling for developers and services. Stof is designed instead to work with all forms of data and meets developers in the formats and schemas they choose to use, in the languages they choose to use. Even complex or unstructured formats can be used efficiently with Stof, like graphics formats, relational tables, etc.
Stof is vital in enabling a shift towards a service-as-software approach, where treating code as data moves solutions from the application layer into the data layer and provides greater security, simplicity, efficiency, and scalability. If our mission resonates with you, please contact us to nerd out and develop the future together.
Hello, World!
In its most basic form, Stof is just a much more friendly and usable JSON document. To understand Stof, imagine turning a JSON document into a dynamic, sandboxed program capable of manipulating itself.
For declaring data, Stof is a superset of JSON - valid JSON will always be valid Stof.
This example is meant to show the connection to JSON, and the simplicity of Stof.
However, we can rewrite this to an equivalent version that looks much nicer. The #[main] attribute tells Stof which functions to call when we run this document.
See Run for more information on the Stof CLI. We'll use the CLI for examples instead of embedding Stof in host languages to keep examples centered on Stof.
Example
For "height", the value is 185.42 because we told Stof the type of that field is "cm", which casts "6ft + 1in" to centimeters. Types are not required for field declarations, but can always be provided. See Units for more information on units in Stof.
Last updated