<
lonejson index
/c/lonejson/

lonejson

lonejson is a single-header C library for schema-guided JSON input and output. It maps JSON objects directly into C structs and back again, with a particular emphasis on object-framed streams, predictable fixed-capacity decoding, and pipelines that need to move large values through JSON without holding everything in memory at once.

The project is built for programs that already know the shape of the data they care about. Instead of constructing a generic DOM and walking it afterward, you describe the fields you want, bind them to a lonejson_map, and parse or serialize through that schema. That approach gives the library its character: it is strongly typed, stream-oriented, and deliberate about ownership and allocation.

The repository also ships a Lua binding with schema-guided decoding, reusable records, object-framed streams, and spool-backed fields.

Performance is comparable or better than some of the fastest streaming implementations in C. The Lua binding is also highly performant, but lacks a comparable competitor so benchmarks are unfair.

Repository: https://github.com/sa6mwa/lonejson
Examples: https://github.com/sa6mwa/lonejson/tree/main/examples

NameType
..parent
v0.1.0/directory