JSON, but simple(r).
Take the following JSON example:
"orders": [
{
"order_id": 0,
"seller_name": "Jane Doe",
"price": 26.99,
"customer_id": 0,
"items": [
]
}
]
Here's the same, in FLOW:
"orders": [
{
"order_id": 0,
"seller_name": "Jane Doe",
"price": 26.99,
"customer_id": 0,
"items": [
]
}
]
But wait - it can be made even simpler! Look now:
orders [
{
order_id 0
seller_name "Jane Doe"
price 26.99
customer_id 0
items []
}
]
Much simpler to write and read.
The goal of FLOW is simple: Make JSON easier to write, while also maintaining backwards compatibility with it, and adding along some (much-required) niceties.
In essence, every JSON data is also valid FLOW data!
However, FLOW has a few differences from its parent:
: and ,)
are optional - in fact, they can be any (non-identifier or reserved) character,
in any amount!
_)
can be unquoted (though some reserved names -
like null,
undefined,
etc.
- will get special treatment, when as values);
Encoded Entities are the way to store binary data in a FLOW file, in an editable way.
Essentially, it is a base-N encoded string, with N being a power of 2.
Specified as follows:
! <base> "<content>"
Where <base> is the base of the string,
and <content> is the encoded content.
Spaces and separators are optional, but not recommended.
A simple example:
!64"SGVsbG93LCBGTE9XIQ=="
This Encoded Entity contains a simple "Hellow, FLOW!".
While less space-efficient than a proper binary encoding, this allows it to be URL-safe and human-editable.
Your classic line (//) and block (/* ... */) comments. Nothing groundbreaking.