ASON is a compact, schema-first data format for LLM prompts, structured APIs, and large datasets. It separates schema from data, so keys are declared once and rows carry only values.
Standard JSON repeats every field name in every record. When you send structured data to an LLM, over an API, or across services, that repetition wastes tokens, bytes, and attention:
[
{ "id": 1, "name": "Alice", "active": true },
{ "id": 2, "name": "Bob", "active": false },
{ "id": 3, "name": "Carol", "active": true }
]ASON declares the schema once and streams data as compact tuples:
[{id@int, name@str, active@bool}]:(1,Alice,true),(2,Bob,false),(3,Carol,true)
Fewer tokens. Smaller payloads. Clearer structure.
| Aspect | JSON | ASON |
|---|---|---|
| Token efficiency | 100% (baseline) | 30–70% ✓ |
| Key repetition | Every object | Declared once ✓ |
| Type annotations | None | Optional ✓ |
| Human readable | Yes | Yes ✓ |
| Nested structs | ✓ | ✓ |
| Serialization | Repeats keys | Schema once, values only ✓ |
| Deserialization | Generic object scanning | Schema-guided decoding ✓ |
| Data size | 100% (baseline) | 40–60% ✓ |
| Binary codec | ✗ | ✓ |
| Typed schema support | Limited | Built-in ✓ |
JSON (100 tokens):
{"users":[{"id":1,"name":"Alice","active":true},{"id":2,"name":"Bob","active":false}]}
ASON (~35 tokens, 65% saving):
[{id@int, name@str, active@bool}]:(1,Alice,true),(2,Bob,false)
The schema header also acts as an inline hint for LLMs and humans: field names and optional types are visible up front instead of being repeated row by row.
TOON (Token-Oriented Object Notation) is another format designed for reducing tokens in LLM prompts. Both ASON and TOON share the core idea of eliminating key repetition for array-of-object data, but they differ significantly in design goals and scope.
TOON — indentation-based, YAML-inspired:
users[2]{id,name,active}:
1,Alice,true
2,Bob,false
ASON — tuple-based, schema-explicit:
[{id@int, name@str, active@bool}]:(1,Alice,true),(2,Bob,false)
| Aspect | TOON | ASON |
|---|---|---|
| Schema declaration | Auto-detected at encode time | Explicit and reusable ✓ |
| Type annotations | None (JSON data model only) | Optional schema hints (int, str, bool, float, arrays, nested structs) ✓ |
| Syntax style | YAML-like indentation | Compact tuple rows |
| Array length markers | [N] — helps detect truncation |
Schema header defines structure ✓ |
| Nested structures | Falls back to verbose list format | Native and recursive ✓ |
| Use case | LLM input only | LLM + serialization + storage + transport ✓ |
| Binary codec | ✗ | ✓ |
| Language implementations | TypeScript / JavaScript only | C, C++, C#, Go, Java, JS, Python, Rust, Zig, Dart ✓ |
| Round-trip fidelity | JSON data model only | Full type fidelity ✓ |
- You want fewer tokens and smaller payloads without losing structure
- You need rich typed data — optional fields, typed arrays, nested structs, keyed entry lists
- You want one format to work across LLMs, APIs, storage, and service-to-service transport
- Your data has rich types — optional fields, typed arrays, nested structs, keyed entry lists
- You need binary encoding alongside text
- You work in multiple languages or need a language-neutral wire format
- You want the schema to act as a self-documenting API contract for LLM prompts
- Your pipeline is LLM prompt input only (you don't parse it back into structs)
- Your data is simple flat tables with no type constraints
{id@int, name@str, active@bool}:(42,Alice,true)
Schema declared once, each row is a tuple:
[{id@int, name@str, active@bool}]:(1,Alice,true),(2,Bob,false),(3,Carol,true)
{name@str, dept@{title@str}}:(Alice,(Engineering))
{id@int, label@str}:(1,hello),(2,)
(blank value = None/null)
{name@str, scores@[int], attrs@[{key@str, value@int}]}:(Alice,[90,85,92],[(age,30),(score,95)])
| Language | Repository | Status |
|---|---|---|
| C | ason-c | ✓ |
| C++ | ason-cpp | ✓ |
| C# | ason-cs | ✓ |
| Go | ason-go | ✓ |
| Java / Kotlin | ason-java | ✓ |
| JavaScript / TypeScript | ason-js | ✓ |
| Python | ason-py | ✓ |
| Rust | ason-rs | ✓ |
| Zig | ason-zig | ✓ |
| Dart | ason-dart | ✓ |
| PHP | ason-php | ✓ |
| Swift | ason-swift | ✓ |
| IDE | Repository | Notes |
|---|---|---|
| VSCode | plugin_vscode | ✓ |
| Jetbrain | plugin_jetbrain | Todo |
| Zed | plugin_zed | Todo |
MIT