Meson is a frontend to a lower-level backend build system. Usually this backend is Ninja, but Apple's & Microsoft's IDEs are also supported. Meson's interface to these backends all share a common baseclass.
So how does Meson's interface to Ninja work? In brief it constructs an AST to serialize, with the aid of some text-escaping utils.
After some writing version check into the low-level buildfiles, doing some validation, & determining exactly which file to atomically-write to...
1/2?