finds.dev← search

// the find

miloyip/json-tutorial

★ 7,937 · C · updated Jun 2024

从零开始的 JSON 库教程

A step-by-step tutorial series (in Chinese) that walks you through building a JSON parser and generator from scratch in C89. Written by Milo Yip, the author of RapidJSON — so the person teaching you actually knows what they're doing. Aimed at C learners who can write basic programs but haven't built anything real yet.

The progression is genuinely well-structured: each unit introduces exactly one concept (number parsing, Unicode, arrays, objects) with exercises before giving you the answer. TDD is baked in from unit 1 — you write tests first, then the parser, which is the right habit to build. The author covers things most beginner tutorials skip entirely: valgrind for memory leaks, IEEE 754 double edge cases, proper UTF-8/surrogate pair handling. Source of truth is the author of nativejson-benchmark, so the implementation decisions are defensible, not guessed.

The tutorial stalls at unit 8 — unit 9 ('finish line') was never written, so you're left without the final benchmark comparison or a tidy wrap-up. The content is in Chinese, which closes it off to a large chunk of developers who'd otherwise benefit. Last meaningful update was 2018 for unit 8; the repo shows a 2024 touch but that's likely a minor fix. Only stores numbers as double, which is fine for learning but means you'll hit precision problems with large integers and can't reuse this as a production parser.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →