arp242 / arp242.net

This is my site. There are many like it, but this one is mine.
https://arp242.net
35 stars 8 forks source link

Thought about Yaml #34

Open Merovex opened 4 years ago

Merovex commented 4 years ago

Hey, I found your article on YAML interesting. I don't have much by way of a dog in the fight, though I do like YAML over TOML. Perhaps I'm just more familiar. On the whole, I found your article well thought out and reasonably balanced. But, I had a couple thoughts to offer:

First, you might like the video platforms have values, which I think applies here. I found the video from a talk on Rust where the author applied this to languages. My point is that each markup language would have its own set of values. Your challenges with YAML might be a value conflict. When you complained that YAML was too complex, it's value was "YAML is expressive and extensible." It is not that they did not reach this goal, but that you disagree with it. Which is perfectly fine. Some people love C# and Haskell...and Pepsi.

Second, you said the goal of YAML is to "YAML data is portable between programming languages." A markup language's aspirations cannot compel all the programming languages to adopt it or apply it properly. That is up to each language. It is unfair to penalize YAML for a third party's problem. Can we blame John Gruber for the various flavors of Markdown?

Anyway, good article. Thank you for making me think. Have a great day.

arp242 commented 4 years ago

My point is that each markup language would have its own set of values. Your challenges with YAML might be a value conflict. When you complained that YAML was too complex, it's value was "YAML is expressive and extensible." It is not that they did not reach this goal, but that you disagree with it.

Probably; but on the other hand, it does have real practical problems people run in to every day.

I don't have time to watch the video now, but it seems interesting and I'll watch it some time later.

Second, you said the goal of YAML is to "YAML data is portable between programming languages." A markup language's aspirations cannot compel all the programming languages to adopt it or apply it properly. That is up to each language. It is unfair to penalize YAML for a third party's problem. Can we blame John Gruber for the various flavors of Markdown?

I don't "blame" anyone for anything, it's just a practical issue and something to be considered. I often see people say things like "I like YAML because it can be used by any language", but in practice this is often not so easy and there are a lot of caveats.

The same applies to the security problems: it's not really the fault of YAML but of the implementations, but it is a practical consideration.

Imagine you have a perfect specification, but for whatever reason all implementations are slow, buggy, and generally terrible. Then in spite of the great specification the format would still "suck" and probably best be avoided, at least until the implementations improve.


The biggest issue (not really mentioned in the article) is that YAML is now being used for a lot of stuff where it's probably not a great fit. A good example is all the CI tools where you're essentially just writing shell scripts in YAML syntax, and let's not even get started on k8s configuration/templated YAML. I'm not saying that shell scripts would be better (they have their own list of problems), but I don't think YAML – or declarative configuration in general – is a good solution for expressing logic. I've been meaning to write a separate article on this.

Regular expressions are a powerful and useful tool, but they probably shouldn't be used as the first solution for every problem. Something similar applies to YAML.