| > I've never met anyone who say's "I like YAML, it is great" Maybe I'm older than you, but I have definitely heard that line. Mostly because the alternatives were XML, INI or the myriad of bespoke formats, relayd/apachehttpd .conf or iptables etc;etc; INI has parsers that operate in different ways and doesn't support heirarchies... so that's not ideal. JSON and YAML came to the fore around the same time, and JSONs limitations in comments and it's picky semantics meant that people did prefer YAML over JSON for human readable configs. YAML itself is fine, it has some really awkward warts and the parsers are usually programatically unsafe in their implementation (leading to less compatible "safe_load" or other types of loaders)[0]; the issue we actually have with YAML is that we: A) Template it (jinja, mustache whatever) B) Put entirely too much stuff into it. (kubernetes manfiests can grow to the hundreds of lines really easily) These problems will affect any configuration file format we choose to use, including TOML (which is comparatively new on the block), because reading templated/enormous files is really difficult. What I've taken to doing is programatically generating objects and then serialising them as whatever my software depends on. It might feel ugly to use an entire turing complete language to generate objects that are mostly static: but honestly... the ability to breakpoint, test and print the subsections of output is astonishingly nice. Then I don't care at all what the format is. [0]: https://www.serendipidata.com/posts/safe-api-design-and-pyya... |
The tooling is super mature, it's easy to emit, it's easy to parse, it's easy to validate, it can just a little hard to read and write by hand (and I mostly blame SOAP for that). Still, basic XML isn't that hard to read or write, thanks to editor support.