A deliberately “flat” — no braces, minimal punctuation — text format for serialising structured data that is:
line-oriented (great for streaming & diffing)
human-writable/readable
trivial to parse with regex or a single-pass state machine
deterministic (canonical ordering by default)
1 Core idea in a tweet
Represent every value as a path = literal pair; nest by dot-separated paths; repeatable paths form arrays; optional lightweight typing tags avoid guesswork.
• Easier line-by-line processing (grep, awk).
• Canonical order -> nicer git diffs.
• No trailing-comma drama, indentation wars, or braces.
• Can be appended to a log stream mid-transfer.
10 Parser pseudo-code (Python-ish)
python
for line in infile:
if line.lstrip().startswith(('#','//','@')) or not line.strip():
continue
path, rhs = line.split('=',1)
typ, literal = ('s', rhs) if ':' not in rhs.split('"',1)[0] else rhs.split(':',1)
value = cast(typ, parse_literal(literal.strip()))
insert(tree, parse_path(path.strip()), value)
parse_path splits dots and [idx], building nested dict/list structures.
11 Limitations / open questions
No explicit null (could add n: tag).
Ordering enforced lexicographically — might surprise when arrays >9 elements (use zero-pad).
No builtin schema – could borrow JSON Schema or Protobuf.
12 Possible extensions
Binary framing → each line prefixed with length for zero-copy streaming.
Encryption/signature footer lines (@sig).
Auto-increment array indices (roles[] = "guest").
TL;DR
FLATSON uses one line per value, hierarchical dot paths plus array indices, optional type hints, and almost no punctuation. It’s ergonomic for humans, predictable for machines, and plays nicely with traditional Unix text tools.
User
How it is compared to toml, ini, conf? What are common mistakes in custom serialisation formats?
Assistant
1. Where FLATSON Sits in the Family
Feature / pain-point
FLATSON
TOML 1.0
“Classic” INI
Generic .conf (nginx, apache…)
Official spec / RFC
Just a proposal (you write it)
Yes (IETF draft / formal TOML doc)
None (dozens of dialects)
Vendor docs only
Parsing complexity
Very low (line-by-line, no look-ahead)
Low/medium (needs table/array state)
Trivial until you hit Unicode, multiline,…
Medium (directives, includes)
Nesting / hierarchy
Dot paths + [idx]
Tables [[foo]], dotted keys
Section headers [foo] only 1 level
Usually flat; some allow blocks
Arrays
Indexed lines → natural diff
Native lists arr = [1,2]
Not standard; vary per parser
Sometimes (key a b c)
Data types
Explicit tag prefix (i:, b:, …)
Implicit & typed literals (42, 3.14, true)
All strings (parser decides)
All strings (or custom)
Multiline strings / blobs
Here-doc (<<<EOF)
3×quotes """ … """
Rare; vendor extensions
Yes (apache <IfModule> …)
Comments
# or //
#
; or #
#, //, /*…*/
Order preserved in file
Canonical (sorted) or stream order
Preserved but not canonical
Usually preserved
Preserved
Streaming / append-friendly
✅ one line = one value
❌ must close arrays/tables
✅ mostly
✅
Git-diff friendliness
Excellent (1 change ⇢ 1 line)
Good (unless arrays inline)
Good
Good
Library support / ecosystem
None yet 😅
Dozens in every language
Huge (but incompatible)
Per tool only
Learning curve for humans
Minutes if you know dot-notation
Low
Near zero
Low but directive-specific
TL;DR
• FLATSON behaves like “INI on steroids”: still line-oriented, but with unambiguous types, unlimited nesting, and canonical order.
• TOML is feature-rich and widely supported, but needs more context to parse (multi-line tables, array closing brackets).
• INI/CONF are the easiest to hand-edit but ambiguous and inconsistent across implementations.
2. What Typically Goes Wrong When People Invent Their Own Format
Below is a checklist of classic pitfalls. (If you stick with FLATSON make sure you dodge these!)
#
Pitfall
Symptoms / why it hurts
1
No Formal Grammar
“Works on my regex” → implementers disagree on edge-cases (escaping, Unicode, comments in strings…).
2
Ambiguous Typing
"true" → string or boolean? Later refactors break configs.
3
Whitespace Sensitivity Without Rules
key = value vs key=value; tabs vs spaces; trailing spaces change meaning.
4
Unescaped Delimiters
You allow = inside values but forget an escaping rule.