News for hackers. Stuff that matters.
Re:XML is better than YAML by kortex on Wednesday September 20, 2023 @10:53PM (#37592709)
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

Re:XML is better than YAML by hmry on Wednesday September 20, 2023 @11:36PM (#37592937)
+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.

Re:XML is better than YAML by throwawaaarrgh on Wednesday September 20, 2023 @11:36PM (#37592935)
Yaml and Json are not configuration formats. They are data serialization formats. Xml is a markup language.
Re:XML is better than YAML by crimsonpowder on Wednesday September 20, 2023 @11:52PM (#37593033)
XML'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.
Re:XML is better than YAML by Too on Friday September 22, 2023 @01:23AM (#37608207)
Using 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