A fast EDN (Extensible Data Notation) reader written in C11 with SIMD boost
2 days ago
- #EDN
- #C11
- #SIMD
- EDN (Extensible Data Notation) is a data format similar to JSON but richer and more extensible, often referred to as 'JSON with superpowers'.
- EDN.C is a fast, zero-copy EDN reader written in C11 with SIMD acceleration, supporting ARM64 (NEON), x86_64 (SSE4.2), and WebAssembly (SIMD128).
- Key features of EDN.C include zero-copy parsing, minimal allocations, a simple API, memory safety with arena allocator, zero dependencies, and comprehensive UTF-8 support.
- EDN.C supports optional Clojure extensions like map namespace syntax, extended character literals, metadata syntax, text blocks, ratio numbers, and extended integer formats.
- The library includes 340+ tests across 24 test suites, ensuring robustness and correctness.
- EDN.C is designed for high performance with SIMD acceleration, zero-copy strings, lazy decoding, and efficient collections.
- Installation and building instructions are provided for Unix/macOS/Linux and Windows, with support for CMake and Make.
- The API includes functions for parsing EDN strings, accessing parsed values, and handling collections like lists, vectors, maps, and sets.
- Custom reader functions can be registered to transform tagged literals during parsing.
- The library supports metadata attachment to values, text blocks for multi-line strings, and various numeric formats including ratios and extended integers.
- Performance optimizations include SIMD acceleration for whitespace scanning and identifier parsing, lazy decoding of escape sequences, and arena allocation.
- The roadmap includes further performance profiling, extended documentation, streaming parsing, and support for additional SIMD platforms like 32-bit x86 and ARMv7.