lloyd/yajl
FreeA fast streaming JSON parsing library in C.
About lloyd/yajl
YAJL (Yet Another JSON Library) is a fast, streaming JSON parsing library written in ANSI C. It is designed to be portable, robust (crash-proof), and minimal in memory footprint. Unlike many JSON libraries that impose a fixed in-memory data representation, YAJL is data representation independent, using callbacks to let users define how to handle parsed tokens. This enables incremental/stream parsing of JSON from a data stream without holding the entire text in memory. YAJL also generates verbose, context-rich error messages. It is released under the permissive ISC license, allowing use in both open source and commercial projects. The library has been tuned for performance while keeping the API clean and simple.
Key Features
Pros & Cons
- Portable (ANSI C) and easy to build on multiple platforms
- Very fast with minimal memory overhead
- Streaming support enables processing large JSON without holding it all in memory
- Callback architecture allows flexible data handling
- Comes with a permissive ISC license (free for commercial and open source use)
- Generates useful error messages to help debug malformed JSON
- No built-in in-memory representation – requires user to implement callbacks (more work for simple use cases)
- Only handles JSON parsing; does not include JSON generation
- May trade off some performance optimizations for interface simplicity (as noted by author)
- Relatively old library (latest stable release from 2007); may lack newer JSON features or security updates