Skip to main content

Format Overview

TTOON has two text syntaxes:

  • T-TOON: indentation-based, optimized for reading and editing by humans
  • T-JSON: bracket-based, closer to JSON tooling and habits
  • Shared typed value layer: both syntaxes use the same value encoding rules

T-TOON is an extension of TOON, the original format from the toon-format project. It keeps TOON's indentation-based object layout and compact tabular form, then adds explicit typed values and the companion T-JSON syntax.

Most parse APIs auto-detect the input format, so in many workflows you can choose the syntax based on readability and interoperability rather than parser configuration.

T-TOON at a Glance

T-TOON removes redundant brackets and uses indentation to express structure.

Object

name: "Alice"
age: 30
active: true

Nested Object

user:
name: "Alice"
address:
city: "Taipei"

Tabular Data

[2]{name,score}:
"Alice", 95
"Bob", 87

The [N]{fields}: header declares row count and column names. This is the compact form for a list of uniform objects.

T-JSON at a Glance

T-JSON keeps JSON-like {} / [] structure, but values still use TTOON typed syntax.

Object

{"name": "Alice", "amount": 123.45m, "id": uuid(550e8400-e29b-41d4-a716-446655440000)}

Array

[1, 2, 3]

Nested

{"user": {"name": "Alice", "scores": [95, 87]}}

Typed Values at a Glance

Both syntaxes share the same 12 built-in typed value encodings:

TypeExample
nullnull
booltrue
int42
float3.14
decimal123.45m
string"Alice"
date2026-03-08
time14:30:00
datetime2026-03-08T14:30:00+08:00
uuiduuid(550e8400-e29b-41d4-a716-446655440000)
hexhex(48656C6C6F)
b64b64(SGVsbG8=)

Three Rules to Remember

  • Strings are always quoted: use "...", not bare words
  • Exact decimal uses m: 123.45m is decimal, 123.45 is float
  • UUID and binary use wrappers: uuid(...), hex(...), b64(...)

Which Syntax Should I Use?

ScenarioRecommended
Human-readable config, logs, or diffsT-TOON
Large tabular datasetsT-TOON tabular
JSON-like downstream integrationT-JSON
Bracket-based nesting preferredT-JSON
Cross-language object exchangeEither

Next Steps

  • Typed Value Reference — Full type semantics, detailed syntax rules, cross-language mapping, Arrow mapping, and RDBMS correspondence
  • Format Detection — Exact auto-detection rules for tjson, ttoon, and typed_unit
  • T-TOON vs T-JSON — More detailed comparison between the two syntaxes