26 ms·
XML is overwrought, YAML is a foot-bazooka, JSON lacks comments, TOML gets unwieldy with more than a few levels of nesting, EDN is neat but kind of obscure...
by kortex 3y ago
XML is overwrought, YAML is a foot-bazooka, JSON lacks comments, TOML gets unwieldy with more than a few levels of nesting, EDN is neat but kind of obscure...
Maybe we need a new configuration format...
ducks
Actually I think something in the space of JSON5, Jsonnet, GCL, HCL, CUE, etc, will be the one to win out in the long run. JSON-but-fix-most-of-the-warts.
Then there's things which almost sit between fully declarative and turing-complete. Maybe Dhall, if it picks up a few more language implementations. Or CEL.
https://github.com/google/cel-spec https://github.com/google/cel-spec
- throwawaaarrgh 3y agoYaml and Json are not configuration formats. They are data serialization formats. Xml is a markup language.
- hmry 3y ago+1 for EDN. In terms of new formats, I'm quite fond of RON, it hits a similar sweetspot in flexibility. JSON5 is nice too, mostly because it's popular. IMO Jsonnet, CUE, etc are just in a different category of complexity since they include code and require a full-blown interpreter to read.
- crimsonpowder 3y agoXML's biggest problem is perfectly demonstrated in Apple's plist files. There's no real way to do lists so 15 ways have been invented ad-hoc.
- Too 3y agoUsing Terraform/HCL as a pre-processor to generate any of the other formats seems like the best now. It is - No footguns (compared to the alternatives) - Basic text-templating - Can do structural manipulations of data. As opposed to many other config-generators that only do string-interpolation of text. Helm and j2.... kill me please, who ever thought this was a good idea - Basic looping, transformations and function calls. Without falling into the full imperative programming language trap. Configuration is still deterministic and directed. - Supports loading data from other sources - Supports comments