·
1 commit
to main
since this release
[2.0.0-preview] - 2025-01-14
🚀 Major Release - ASON 2.0
Complete rewrite of ASON with new syntax, architecture, and optimizations.
Added
-
New ASON 2.0 Syntax - Cleaner, more intuitive format
- Sections with
@sectionsyntax (replaces object references) - Semantic references
$varinstead of numeric#0 - Tabular arrays
[N]{fields}with pipe|delimiter - Dot notation for nested objects
config.debug:true - Support for inline objects
{key:value}and inline arrays[a,b,c]
- Sections with
-
Lexer → Parser → AST → Compiler Architecture
- Complete modular parsing pipeline
- Token-based lexer (
src/lexer/Lexer.js,TokenType.js,Token.js) - Recursive descent parser (
src/parser/Parser.js) - AST nodes (
src/parser/nodes/) - Optimized compiler/serializer (
src/compiler/Serializer.js)
-
Advanced Optimizations
- Inline Compact Objects: Small objects serialized as
{key:value}without spaces - Dot Notation in Schemas: Nested objects flattened in tabular arrays
[N]{id,price.amount,price.currency} - Array Fields in Schemas: Arrays marked with
[]suffix[N]{id,tags[]} - minRowsForTabular = 2: Tabular optimization from just 2 rows
- Inline Compact Objects: Small objects serialized as
-
Smart Analyzers
ReferenceAnalyzer: Detects repeated strings for$def:sectionSectionAnalyzer: Identifies large objects for@sectionmarkersTabularAnalyzer: Finds uniform arrays with support for nested objects and arraysDefinitionBuilder: Manages reference definitions
Changed
-
Breaking: Complete syntax change from ASON 1.x to ASON 2.0
&obj0→@section(sections instead of object references)#0→$var(semantic variable names)@field1,field2→[N]{field1,field2}(explicit count + schema),→|(pipe delimiter in tabular arrays)
-
Improved Compression
- Better detection of optimization opportunities
- Combined optimizations (dot notation + arrays + inline objects)
- Smarter decisions on when to use each format
-
Enhanced Round-Trip Fidelity
- 100% lossless compression/decompression
- Proper handling of edge cases (negative numbers, nested structures)
- Fixed YAML-style list parsing at root level
Fixed
-
Parser Bugs
- Fixed YAML-style lists (
-) not working at root level - Fixed nested object parsing in arrays
- Fixed negative number tokenization
- Fixed empty object/array handling
- Fixed YAML-style lists (
-
Serializer Issues
- Fixed duplicate properties in sections
- Fixed illogical ordering (sections now appear after primitives)
- Fixed proper newline handling
Documentation
- Updated
/docs/index.html- ASON 2.0 Playground - Updated
/docs/docs.html- ASON 2.0 Documentation - Updated
/docs/benchmarks.html- ASON 2.0 Benchmarks - Updated
/docs/tokenizer.html- Token Comparison Tool - All examples updated to ASON 2.0 syntax
Performance
- 20-60% token reduction vs JSON (maintained from 1.x)
- Improved human readability with semantic references
- Better LLM compatibility with cleaner syntax
- Scalable format suitable for large datasets
Migration Guide
ASON 1.x is not compatible with ASON 2.0. To migrate:
- Recompress your data with ASON 2.0
- Update any manual ASON strings to new syntax
- See
/docs/docs.htmlfor complete syntax reference
Internal Changes
- Complete rewrite of codebase (Lexer → Parser → AST → Compiler)
- Improved test coverage (30 passing tests)
- Better separation of concerns
- Modular analyzer system
- Cleaner code organization