A project of the Open Tech Foundation.
Caution
EXPERIMENTAL PRE-RELEASE
DSF is currently in an experimental, pre-release state. The specification and implementations provided here are for research and feedback purposes only. APIs and document grammar are subject to breaking changes.
DSF (Data Structure Format) is a human-readable, structured data format designed for configuration and data interchange. It emphasizes predictability, fast parsing, and explicit typing via constructor literals.
- Unquoted Keys: Clean, minimal syntax.
- Backtick Strings: No more escaping double quotes.
- Explicit Literals:
T,F,Nfor True, False, and Null. - Constructor Literals: Native support for Dates
D(), BigNumbersBN(), and BinaryB(). - Single-line Comments: Use
//for notes and documentation. - Fast Parsing: Designed for direct byte-level processing.
- DSF 1.0 Specification (Draft)
- Migration Guide (JSON → DSF)
- Edge Cases & Constraints
- Standardized Error Codes
- Comparison with Other Formats
The ref-impl/ directory contains reference implementations for various languages:
DSF consistently achieves a reduced payload size (16%–20%) compared to JSON. Most notably, optimized DSF implementations can outperform native JSON parsers in speed.
| metric | language | JSON | DSF | difference |
|---|---|---|---|---|
| 📏 Payload Size | Go | 6.28 MB | 5.13 MB | 📉 -18.3% |
| Rust | 6.45 MB | 5.13 MB | 📉 -20.5% | |
| TypeScript | 6.28 MB | 5.25 MB | 📉 -16.5% | |
| Python | 7.08 MB | 5.93 MB | 📉 -16.2% | |
| ⏱️ Parsing Time | Go | 99.6 ms | 63.2 ms | 🚀 37% faster |
| Rust | 72.2 ms | 47.1 ms | 🚀 35% faster | |
| TypeScript | 33.8 ms | 321.5 ms | 9.5x slower | |
| Python | 94.8 ms | 84.7 ms | 🚀 10% faster | |
| ✍️ Serialization | Go | 104.0 ms | 44.4 ms | 🚀 57% faster |
| Rust | 15.4 ms | 23.2 ms | 1.5x slower | |
| TypeScript | 15.4 ms | 104.4 ms | 6.8x slower | |
| Python | 76.4 ms | 204.0 ms | 2.7x slower |
Note
TypeScript benchmarks compare the DSF reference implementation against Bun's native JSON library.
This project is dedicated to the public domain under the CC0 1.0 Universal (CC0 1.0) Public Domain Dedication.
