Token-Optimized Notation Language (tonl.dev)

đŸ¤– AI Summary
TONL (Token-Optimized Notation Language) is a text-first serialization format designed to be LLM-friendly and reduce token costs and processing time compared with JSON. It claims 32–50% fewer tokens by eliminating repeated keys, excessive quoting, and bracket noise, while preserving full round-trip fidelity to JSON. Type hints (u32, str, bool) add ~20 tokens but enable schema validation, TypeScript generation, and better LLM parsing—still delivering ~32% size savings versus JSON. The project is pure TypeScript, zero runtime dependencies, ships as a CLI and libraries for Node/Browser/Deno/Bun, and includes a short system-prompt snippet so any LLM can parse TONL reliably. Beyond compactness, TONL is a complete data platform: JSONPath-like query support, streaming parsing with constant memory for multi-gigabyte files, built-in change tracking and atomic saves, and schema validation. It offers hash indexes (O(1) lookups) and B-Tree indexes (O(log n)) that yield 10–1600x speedups over sequential scans; benchmarks show parse/encode times ~1.2ms/~0.8ms for 1MB, hash lookup ~0.05ms, B-Tree range ~0.3ms, and streaming ≈50MB/s with <100MB (often ~10MB) RAM. With CLI commands for encode/decode/query/validate and production-ready claims (v1.0+, 496 tests), TONL targets teams wanting to cut LLM API bills and speed large-scale AI/ETL workflows without introducing supply-chain risk.
Loading comments...
loading comments...