Skip to content
fluttercandiesPublic

About

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.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

LON

LON — compact, lossless, AI-first object notation

LON format v1 Lossless JSON o200k benchmark uses LON as baseline GitHub repository

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.

Why LON

  • 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.

Quick example

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 name is 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.

Implementations

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.

Repository layout

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

Token benchmark

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 benchmark

Design boundary

LON 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.

License

LON is available under the BSD 3-Clause License.

About

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.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages