From dc983b42abc8e3cbfdce49a1e2b8783673bb9b6d Mon Sep 17 00:00:00 2001 From: woutervancgi Date: Thu, 13 Nov 2025 14:52:45 +0100 Subject: [PATCH] docs: add YAML comparison example to README (#122) Added YAML example as well as it's more fair to compare to YAML than to JSON. Note then when objects or arrays contain more nesting TOON might actually become less efficient than YAML. --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 45dce1f..16fe178 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,19 @@ AI is becoming cheaper and more accessible, but larger context windows allow for } ``` -TOON conveys the same information with **fewer tokens**: +YAML conveys the same infromation with **fewer tokens**: + +```yaml +users: +- id: 1 + name: Alice + role: admin +- id: 2 + name: Bob + role: user +``` + +TOON conveys the same information with even **fewer tokens**: ``` users[2]{id,name,role}: