Live data from Hacker News

YAML document from hell (2023)

ruudvanasseldonk.com

31–40 of 144 posts

Re: YAML document from hell (2023)

#31

stupid question: why dont they announce a newer version of YAML that is not backwards compatible and allow only quoted strings in their parser?

> that is not backwards compatible This would be a massive breaking change for Kubernetes. There are piles and piles of YAML all around the opensource that would need updating. It would be very hard to adopt. Also, quoting strings 100% of the time just looks ugly in my opinion. Not a big deal with autogenerated YAML, or YAML that I do not maintain, but for anything handwritten it's annoying.

how is it annoying...? it's literally like that in almost every single language out there. IMO seeing unquoted strings in YAML feels weird.

Re: YAML document from hell (2023)

#34
post #11

not only is YAML a pain but JSON has native parser in major languages, while not yaml. I find it crazy some people are still actively choosing this over JSON (or alternatives)

This is a case of the right tool for the right job. YAML is far easier to read and parse as a human than JSON.

If you're passing data between processes, and you still want the data to be human readable, then JSON is a good choice.

If you're writing a configuration file that's going to be edited by a human, then YAML is easier to look at and understand.

Re: YAML document from hell (2023)

#36

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.

No one mentioned HashiCorp HCL so far, though it's really a shame that it didn't get much traction...

Re: YAML document from hell (2023)

#37
post #31

Earlier quoted context omitted.

> that is not backwards compatible This would be a massive breaking change for Kubernetes. There are piles and piles of YAML all around the opensource that would need updating. It would be very hard to adopt. Also, quoting strings 100% of the time just looks ugly in my opinion. Not a big deal with autogenerated YAML, or YAML that I do not maintain, but for anything handwritten it's annoying.

how is it annoying...? it's literally like that in almost every single language out there. IMO seeing unquoted strings in YAML feels weird.

As I said, it's subjective. I like this

    image: my-repo.com/my-app:v1
    imagePullPolicy: Always
more than this

    image: "my-repo.com/my-app:v1"
    imagePullPolicy: "Always"
That's all. Not sure about quoting keys though.

Re: YAML document from hell (2023)

#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/)?

Re: YAML document from hell (2023)

#40
post #15

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.

I wish I had a good answer for you. I've been dissatisfied with Dhall, Nickle, Cue, and possibly others. Dhall's type system is both too strong (you have to plumb type variables by hand if you want to do any kind of routine FP idioms) and too weak (you can't really _do_ much with record types - it's really hard to swizzle and rearrange deeply nested records). On top of that, the grammar is quite difficult to parse. Y…

> Maybe Nix in pure eval mode, absurd as that sounds?

It doesn’t sound absurd, it’s pretty nice. What do you think about https://rcl-lang.org?

Post reply on HN