Live data from Hacker News

YAML document from hell (2023)

ruudvanasseldonk.com

41–50 of 144 posts

Re: YAML document from hell (2023)

#41
post #33
post #22

I find it remarkable that YAML has become our goto for configuration when it is riddled with parsing traps and inconsistent behaviour that catches out even experienced developers

It's because other config formats aren't as expressive.

> It's because other config formats aren't as expressive.

Oh yeah it is literally the best of a bad bunch in my opinion

I'm hopeful of languages like CUE https://cuelang.org/

Re: YAML document from hell (2023)

#43

Almost all of this is solved by basically putting quotes around strings. Yaml has its uses cases where you want things json doesnt do like recursion or anchors/aliases/tags. Or at least it has had - perhaps cue/dhall/hcl solves things better. Jsonnet is another. I havent tried enough to test how much better they are.

It's very counter-intuitive to me that 22:22 would need to be a quoted string, since functionally it's a K-V-pair. YAML itself even uses : in the Dict syntax!

Re: YAML document from hell (2023)

#44
Perfectly normal YAML document detected.

More seriously: this is a good overview of the reasons I dislike YAML as a web configuration language. There's too much overlap between the "friendly" auto-type-determination in YAML and the symbols used in web tech, from colons to Norway having a TLD. It wouldn't be so bad if yaml parsers could use expected type of each value as a hint, but that's not a feature in any parser I've met, so I'd rather just not use yaml for anything that's going to end up describing a web service.

Re: YAML document from hell (2023)

#45
post #22

I find it remarkable that YAML has become our goto for configuration when it is riddled with parsing traps and inconsistent behaviour that catches out even experienced developers

And furthermore I find it remarkable how much people like the visual format where you indent nested things with whitespace. I'm pretty sure it's the main reason Python took off as well.

Re: YAML document from hell (2023)

#47
post #38

So... what are the good alternatives to yaml? For quite some time I thought toml, but the way you can spread e.g. lists all over the document can also cause some headaches. Dhall is exactly my kind of type fest but you can hit a hard brick wall because the type system is not as strong as you think.

What about KDL ( https://kdl.dev/ ) or Pkl ( https://pkl-lang.org/ )?

KDL is really, really nice. And lightweight.

Re: YAML document from hell (2023)

#50
post #19

We found yaml to be a great exchange format for electronic exam data. It allows us to put student submitted answers and source code into a yaml file and there is no weird escaping. It's very readable with a text editor. And then we just add notes and a score as a list below and then there's the next submission. For readability of large blocks of texts that may or may not contain various special characters and newline…

What is so verbose about a cdata directive? Everybody complains about XML being verbose, never once heard complains about HTML being too verbose.
Post reply on HN