November 23, 2026
Introducing apt-core-json
Today I finalized apt-core-json, the first in a new set of core libraries for APT to bring APT into the new decade, following the latest C++23 standard, with a focus on memory safety, absurd amounts of template metaprogramming, std::expected, and of course: coroutines and event loops, leading to a Varlink library as the next big deliverable. The running joke is that the “Core” stands for “Coroutines and Event Loop”.
The JSON library was one of the first things needed for a Varlink library. JSON is not particularly hard, but I did not want to write my own parser (and I deleted my old writer!). Instead of a custom library, I had to pick json-c as the backend. I then had to work around a whole ton of issues with json-c not being strict enough; heck that thing will read embedded NUL bytes in strings and then silently truncate them! So we had to implement a verification step that understands enough JSON to reject “\u0000” as well as literal NUL bytes in input strings. In an optimal world, I’d just use sd-varlink, but obviously it’s not available on Hurd.
...
Read more 》