A Fast, Compliant JSON Pull Parser for Writing Robust Applications
Talkat CppCon 2023 · on Tuesday, 2023-10-03· at 09:00· Cottonwood 2/3, 6700 North Gaylord Rockies Boulevard·
summary
An open source, fully validating pull parser is presented as a middle ground between DOM and SAX: it claims competitive speed versus boost.JSON and rapidjson while avoiding simdjson’s shortcut (simdjson is faster because it skips full validation). It uses O(1) memory (no dynamic allocations while parsing), exposes a pull API that lets callers express expected schema (automatic error handling), compiles as header-only C++ (uses modern C++ features), and is already used in a production codebase.
AI-written summary · about
chapters (28)
- 0:00JSON parsing challenges
- 1:08Traditional parsers fall short
- 2:10Design goals for fast parser
- 3:35JSON grammar basics
- 6:43DOM parsers limitations
- 10:51When DOM parsers useful
- 12:14SAX parsers drawbacks
- 17:09Range algorithms and lazy
- 23:24Range algorithms and JSON
- 25:52JSON pull parser concept
- 26:14Pull parser core mechanics
- 31:49Pull vs DOM/SAX
- 32:52Schema-aware parsing API
- 34:15Higher-level parsing abstractions
- 43:46Extending library with algorithms
- 45:10Parser design principles
- 46:16Open-source release and plans
- 46:39Q&A: Benchmarks
- 47:41Q&A: TypeScript schemas
- 48:44Q&A: Array parsing
- 49:27Q&A: Higher-level interfaces
- 49:47Q&A: Deep recursion
- 50:51Q&A: Schema automation
- 51:58Q&A: iOS compatibility
- 53:22Q&A: C++ standards
- 54:03Q&A: Streaming JSON
- 54:24Q&A: Clang JSON output
- 54:46Q&A: Duplicate keys
related talks
20mHelp! My Codebase has 5 JSON Libraries - How Generic Programming Rescued Me
43mAsami: Turn your JSON into a Graph in 2 Lines
43mEmbracing the Web with JSON and PLV8
56mEverything is serialization
36mWriting a Zero-Copy Database Parser from the Ground Up
48mA Tree Full of Object Data
30mLessons from 4 Years of writing the driver for MongoDB
34mThe Road to Hype: How NoSQL became Serverless
