4 ms·
Using YAML for critical infrastructure specification is one of the stupidest things we’ve ever done as an industry.
by kasey_junk 7y ago
Using YAML for critical infrastructure specification is one of the stupidest things we’ve ever done as an industry.
- pokoleo 7y agoIt’s better than XML!
- angry_octet 7y agoWhen you see how many parsing ambiguity problems there are with YAML you begin to wish for XML. Other modern alternatives include: https://jsonnet.org/ https://jsonnet.org/ https://json5.org/ https://json5.org/ See https://arp242.net/yaml-config.html https://arp242.net/yaml-config.html
- mschuster91 7y agoXML is verbose as hell but: - it's unambiguous - with a proper XSD schema you can leverage validation already during parsing, which means you don't even have to boot your application at all - simply load your configuration in any XML parser and you'll automatically catch errors.
- elsonrodriguez 7y agoWhat are the alternatives? The minute you get into using code for these things, cleverness begins to turn configuration repos into something you have to debug before editing.
- james_s_tayler 7y agoInstead you have YAML you have to debug because all of a sudden you have decided to support Norway as a country and something about Norway's country code and the way YAML handles Boolean values bites you in the ass.
- unwind 7y agoI was curious enough to Google and found [1]. It turns out YAML supports figuring out the type of a value from the plain value itself. Norway's cc is "NO", which parses as a Bool instead of a string. The solution is to always quote strings. [1] https://medium.com/@lefloh/lessons-learned-about-yaml-and-norway-13ba26df680 https://medium.com/@lefloh/lessons-learned-about-yaml-and-no...
- gregwebs 7y agoI have been able to replace my yaml with well typed cue. https://cuelang.org/ https://cuelang.org/
- zapita 7y ago+1 for cue, it is very impressive especially given how new it is.
- kimburgess 7y agoIn additional to the sibling cuelang recommendation, there is also https://dhall-lang.org/ https://dhall-lang.org/.
- dang 7y agoOk, but can you please explain why? Otherwise it's a shallow dismissal per the site guidelines: https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html.
- p10jkle 7y agoI don't really mind it