N
Nigel Tao
nigeltao.github.io · Personal blog · on HN since 2018
Nigel Tao, a software engineer who works on Wuffs, writes about file formats, parsers, and compression such as PNG, JSON, QOIR, and Zstandard.
What HN saysHN links it for details on Wuffs, which Chromium uses for untrusted GIF data, and for his JSON-with-commas-and-comments and PNG decoder write-ups.
29HN people shared it
12linked it in comments
32stories submitted
918story points
4 months agolast shared
2018people per year2026
Most-shared posts
- 1JSON with Commas and Comments10 people · 156 points · first shared 2021 · 245 comments on HN
- 2Wuffs’ PNG image decoder5 people · 473 points · first shared 2021 · 138 comments on HN
- 3Jsonptr: Using Wuffs' Memory-Safe, Zero-Allocation JSON Decoder4 people · 11 points · first shared 2020 · discussion on HN
- 4Dumbindent: Because 93% of the time was spent in Clang-format4 people · 5 points · first shared 2020 · 1 comments on HN
- 5The Eisel-Lemire ParseNumberF64 Algorithm3 people · 52 points · first shared 2020 · 2 comments on HN
- 6Show HN: Handsum: An LQIP Image File Format3 people · 4 points · first shared 2026 · discussion on HN
- 7QOIR: A fast, simple, lossless image file format3 people · 1 points · first shared 2022 · discussion on HN
- 8Zstandard Worked Example2 people · 176 points · first shared 2022 · 50 comments on HN
- 9Empty Intervals Are Valid Intervals2 people · 5 points · first shared 2025 · discussion on HN
- 10From JPEG to JFIF via an Io.Writer2 people · 5 points · first shared 2021 · discussion on HN
- 11C++ Coroutines1 people · 11 points · first shared 2023 · 1 comments on HN
- 12Producing Uncompressed PNG Files1 people · 6 points · first shared 2025 · discussion on HN
- 13Premultiplied Alpha1 people · 3 points · first shared 2022 · discussion on HN
- 14Custom eBPF Helpers1 people · 3 points · first shared 2021 · discussion on HN
- 15Rook's Law: There's Always a Limit1 people · 2 points · first shared 2024 · discussion on HN
What HN people wrote when they linked it
nigeltao · 2025-10-24
It's a great idea. Chromium uses Wuffs to parse GIF data from the untrusted network.
There's also a "wget some JSON and pipe that to what Wuffs calls example/jsonptr" example at https://nigeltao.github.io/blog/2020/jsonptr.html#sandboxing
gforce_de · 2025-08-26
Thanks for making that clear. But is it worth the hassle?
https://nigeltao.github.io/blog/2021/fastest-safest-png-decoder.html
PNG decoding seems to be fast enough:
tree1 - PEP = 0.412 ms PNG = 0.25 ms font - PEP = 0.602 ms PNG = 0.663 ms nz_scene - PEP = 32.121 ms PNG = 3.069 ms Anyway, PEP is interesting!
dgacmu · 2026-02-25
Or consider jsonc - json with comments - or jwcc - which is json with comments and trailing commas
to make life a little easier.
https://jsonc.org/
https://nigeltao.github.io/blog/2021/json-with-commas-comments.html
There are a lot of implementations of all of these, such as https://github.com/tailscale/hujson
tome · 2025-05-26
I call this the Peter Principle of Programming:
"Code increases in complication to the first level where it is too complicated to understand. It then hovers around this level of complexity as developers fear to touch it, pecking away here and there to add needed features."
http://h2.jaguarpaw.co.uk/posts/peter-principle/
Seems like I'm not the first one to notice this either:
https://nigeltao.github.io/blog/2021/json-with-commas-comments.html
vanderZwan · 2024-08-04
Not to mention the part where adding compressors like this somewhat defeats the purpose of using a simple format like QOI (although at least zstd is faster than gzip, let alone 7zip).
But if we're modifying things like that, then they might as well make use of Nigel Tao's improved QOIR format, and replace the LZ4 compressor it uses with zstd. That's probably faster and likely compresses better than QOI.
[0] https://nigeltao.github.io/blog/2022/qoir.html
[1] https://github.com/nigeltao/qoir
hddqsb · 2023-09-13
I can relate. But after using JSON for a while (in files that I edit by hand), I found that I really want comments and trailing commas (which leads to https://nigeltao.github.io/blog/2021/json-with-commas-comments.html). Next I'd probably want multiline strings (leading to https://github.com/json5/json5).
But if you use those extensions, all your tooling breaks.
(Aside: I think the real bike-shedding would start when you want to add some syntax for raw string literals, e.g. heredocs; it's one of those features that feels redundant, until the day when you really need it and you can't bear the pain of repeatedly escaping and unescaping.)
fl0ki · 2023-08-08
Serious question though, why use "JSON" at all then? You can just admit it's JWCC, which is fine, at least that's a distinct term -- but even that's not a spec, it's just a blog post that very few people even know about. Even that same blog post endorses using TOML, the spec generally preferred for things that may need to be human-edited. It meets humans half-way a lot better than even JWCC, which is the kind of practicality I think even Grug would prefer.
https://nigeltao.github.io/blog/2021/json-with-commas-comments.html#wh…
And while we're at it:
https://www.arp242.net/json-config.html
https://dzone.com/articles/why-json-isnt-a-good-configuration-language
https://revelry.co/insights/development/json-configuration-file-format…
evntdrvn · 2023-05-21
You might be interested to check out JSONC and JWCC/HuJSON
https://nigeltao.github.io/blog/2021/json-with-commas-comments.html
https://github.com/tailscale/hujson
edflsafoiewq · 2023-03-11
> Software has a Peter Principle. If a piece of code is comprehensible, someone will extend it, so they can apply it to their own problem. If it’s incomprehensible, they’ll write their own code instead. Code tends to be extended to its level of incomprehensibility.
https://nigeltao.github.io/blog/2021/json-with-commas-comments.html
adgjlsfhk1 · 2022-12-18
lz4 is also pretty small https://nigeltao.github.io/blog/2022/qoir.html is an implementation of QOI with some tweaks+lz4 and it's still pretty tiny
ttiurani · 2022-08-08
Another name for this is JWCC. IMO very good argument for this feature set here:
https://nigeltao.github.io/blog/2021/json-with-commas-comments.html
ivoras · 2021-04-06
Surprisingly, Go's png decoder is half as slow as the default libpng :(
https://nigeltao.github.io/blog/2021/fastest-safest-png-decoder.html#a…