PyData Global 2025

Modernizing JSON for Julia
2025-12-09 , Data Engineering & Infrastructure

JSON support and interfaces vary widely across languages and Julia has been no different. As Julia has evolved as a language, patterns and best practices with regards to interfaces have also evolved with how to best leverage Julia's unique strengths: multiple dispatch, library composability, and zero-cost abstraction. The original JSON.jl package has been rewritten from scratch for a (finally!) 1.0 release bringing JSON support in Julia up to modern best practices and patterns, combining functionality from at least 3(!) existing JSON packages into one unified library offering.


Over Julia's history, there have been a number of JSON packages providing various forms of JSON support:
* JSON.jl: oldest/original JSON package; very simple JSON support for reading/writing for mostly just core Julia data structures
* LazyJSON.jl: package that attempted to provide "lazy" parsing support where JSON could be scanned without fully materializing objects in memory; never quite fully "finished" the package/functionality and was thus, never really widely adopted
* JSON2.jl/JSON3.jl: Iterations on interfaces to support custom struct serialization/deserialization in Julia

The new 1.0 release to the JSON package combines the functionality from all these packages in a single, unified, and modern interface. Package functionality now includes:
* Same basic JSON support of reading/writing for core datastructures
* Support for lazily processing JSON including extracting deeply nested values without intermediate materialization
* A new JSON.Object structure that mimics a Dict{Symbol, Any} but preserves insertion (or in this case parse) order, allows dot access, and in most cases is faster with fewer memory allocations than Dict.
* Custom struct serialization/deserialization support that includes specifying field defaults, custom field lower/lift functionality, or directly mutating fields (of mutable structs) while parsing

This talk aims to cover the historical context leading to the JSON.jl 1.0 release, how the package leverages clean internal interfaces to provide a ton of functionality without exploding the codebase, and why the decision was made to ultimately rewrite the original JSON.jl package for a 1.0 release instead of yet-another-JSONX.jl type package.


Prior Knowledge Expected:

No

A core contributor to both the Julia language and package ecosystem for over a decade.