4 ms·
YAML sucks but so does TOML, especially when it comes to nested data structures like the layout.yaml shown on the front page. There are no good configuration l
by donio 5y ago
YAML sucks but so does TOML, especially when it comes to nested data structures like the layout.yaml shown on the front page.
There are no good configuration languages in existence and there never will be. We have rejected Lisp/sexp so now we must suffer endlessly.
- nine_k 5y agoI would say that Dhall is fine, just from a parallel universe. JSON is close to sexps, but it sucks when comments are not allowed.
- nathell 5y agoWhich is why EDN is so much better for config.
- rch 5y agoTake a look at HOCON (Human-Optimized Config Object Notation) https://github.com/lightbend/config/blob/main/HOCON.md https://github.com/lightbend/config/blob/main/HOCON.md
- KajMagnus 5y agoYes! I logged in just to mention HOCON, then I noticed you have mentioned it already :- ) So, the project you linked to is Java / Scala: https://github.com/lightbend/config https://github.com/lightbend/config And there're also (basic? complete?) HOCON parsers in Javascript and Rust — I investigated this a while ago, because I want to use HOCON everywhere in my projects: https://docs.rs/hocon/0.5.1/hocon/ https://docs.rs/hocon/0.5.1/hocon/ (Rust) https://www.google.com/search?q=hocon+javascript https://www.google.com/search?q=hocon+javascript (Js, a few different) The Rust version: > This implementation goal is to be as permissive as possible, returning a valid document with all errors wrapped in `Hocon::BadValue` when a correct value cannot be computed How nice :- ) (it seems to me)
- IshKebab 5y agoI agree that TOML sucks for nested structures. JSON5 is probably the best option at the moment. https://json5.org/ https://json5.org/ * Instantly obvious what the structure is (unlike YAML or TOML). * Everyone knows JSON already. This just makes it a bit nicer. * No noob security mistakes or type confusion caused by underquoting like YAML.
- somethingwitty1 5y agoDon't forget the truncation problem with YAML/TOML. A partially read/transmitted YAML/TOML file is often still considered valid.
- dflock 5y agoThat also makes it really easy to concatenate them, either `cp a.yaml + b.yaml c.yaml` or just `cat a.yaml >> b.yaml` - which is quite nice, compared to trying to do this with JSON etc... files.
- brundolf 5y agoI think JSON would be perfect if it a) allowed comments, and b) had multi-line strings. It has exactly five data types, each with very clear and distinct notation that nests consistently (the top level isn't somehow "special" and there's no messing with significant whitespace). Only two collection types: keyed, and unkeyed. In some sense it feels like the apotheosis of untyped data-modeling.
- xxpor 5y agoI just wish JSON had fixed decimal numbers, a timestamp type, and a binary blob type :/
- deleted 5y ago[deleted]
- sammorrowdrums 5y agoa) reminds me so much of this classic https://thedailywtf.com/articles/the-inner-json-effect https://thedailywtf.com/articles/the-inner-json-effect “Tell us what you did to JDSL,” one of the VP’s asked. “I don’t think I did anything,” Jake answered. “I’ve only been here two weeks, trying to learn JDSL and how the customer portal works. I don’t even know how to deploy it!” “You made a few commits to Subversion!” Tom shouted. “Well, yes. I added a few code comments, trying to–” “You can’t use comments in JDSL!” Tom shouted. “THAT’S WHAT BROKE IT!!”
- aniforprez 5y agoThat 100% has to be fake. I NEED it to be fake. Are there production systems that work like this? Du they have one "rockstar" developer who does stuff like this?
- fwip 5y agoMost of TDWTF is a kernel of truth surrounded by about three pages of fiction.
- sysbot 5y agoHave you looked at Cuelang [1] as a configuration language or source of truth?. It's still new but it's a superset of JSON but attempted to combine data/schema into one and reject inheritance and replace with validation instead. [1] https://github.com/cuelang/cue/tree/master/doc/tutorial/basics https://github.com/cuelang/cue/tree/master/doc/tutorial/basi...
- wtetzner 5y agoI agree about sexps, it feels like the right default for storing human readable data. The only place where I think it's a little weak is when used more like markup, since data would need to be in quoted strings. That definitely seems like a solvable problem though.