English · 简体中文
Language Object Notation (LON) is a compact, canonical, and lossless text encoding of the JSON data model. It is designed for AI-first data exchange without making humans or models guess types, boundaries, schemas, or omitted structure.
Format version:
LON v1
This repository is a multi-language monorepo: the normative specification, conformance fixtures, benchmarks, and branding are language independent, and each implementation lives in its own directory.
- Lossless JSON text conversion. Preserves object-member order, duplicate members, string code units, and number lexemes.
- AI-first, not AI-only. Removes redundant syntax while retaining familiar JSON delimiters and explicit type boundaries.
- Self-describing tables. Repeated record keys may be factored into a visible schema followed by semicolon-delimited rows.
- One canonical encoding. Different accepted spellings normalize to one deterministic output.
- No hidden context. No aliases, key dictionaries, numeric references, external schemas, or model instructions.
- Resource-bounded. Parsing, expansion, nesting, input, and output are limited before unsafe allocation or multiplication.
JSON:
{"users":[{"id":1,"name":"Ada"},{"id":2,"name":"Bob"},{"id":3,"name":"Lin"}]}Canonical LON:
{users:[id name;1 Ada;2 Bob;3 Lin]}
The payload remains self-describing:
[and]remain the decoded array boundary.id nameis the visible record schema; the first;ends it.- Each later
;starts another row whose width is validated against the schema. - Spaces separate fields without adding row parentheses or another delimiter.
For small or non-uniform data, LON stays close to JSON:
{"id":7,"name":"Ada","active":true}{id:7 name:Ada active:true}
See the normative LON v1 specification for the complete grammar and canonical table-selection rules.
| Language | Status | Entry |
|---|---|---|
| Dart | Ready | dart/ · lon on pub.dev |
| Rust | Ready | rust/ · lon on crates.io |
Each implementation is validated against the shared conformance fixtures.
| Path | Purpose |
|---|---|
spec/lon-v1.md |
Normative format specification |
conformance/v1.json |
Cross-implementation conformance fixtures (schema) |
benchmark/ |
Reproducible multi-format token benchmark |
editors/ |
Editor support (VS Code syntax highlighting and language configuration) |
assets/ |
Scalable LON logo and standalone mark |
dart/ |
Dart implementation, CLI, and tests |
rust/ |
Rust implementation, CLI, and tests |
The reproducible benchmark compares LON, Compact JSON, TOON, YAML, and Pretty JSON across 27 deterministic small, medium, and large scenarios. Every payload must decode to the original JSON value before it is counted, and LON is the comparison baseline.
Read the human-readable benchmark report or the machine-readable results. Reproduce it:
cd benchmark
bun install --frozen-lockfile
bun run benchmarkLON encodes the JSON data model. It does not add comments, timestamps, binary blobs, references, arbitrary object types, or inferred application schemas. Keeping that boundary is what makes canonical round trips and unambiguous AI/human interpretation enforceable.
LON is available under the BSD 3-Clause License.