Live data from Hacker News

In Defense of YAML

blog.atomist.com

1–10 of 173 posts

Re: In Defense of YAML

#3
> This is not structured data. This is programming masquerading as configuration

I find myself expressing this same opinion to people on a frequent basis. See ansible for another big example. Ansible has a try/catch equivalent in yaml [0]!

Unfortunately, YAML is more or less a lowest common denominator for these sorts of interactions - being usable from any language is a really big boon. Would love to see the world adopt a trivial lisp or similar for this sort of thing, but that feels a ways off.

Helm 3 introducing lua, for example, is a big step forward. Pretty much exactly what I've been envisioning for making k8s deployments less crummy, so I hope they end up with a good product. [1] Helm 2 is using Go-templated YAML, and it's terribly unergonomic and not particularly maintainable. Until you run templating, it's not even valid yaml, so text editors are terribly useless in aiding you with linting.

[0]: https://docs.ansible.com/ansible/latest/user_guide/playbooks...

[1]: https://sweetcode.io/a-first-look-at-the-helm-3-plan/

Re: In Defense of YAML

#5
I highly agree with inappropriateness of YAML for GitLab CI/CD configuration. It does work for simple use cases and/or in small repositories - however, doing something slightly more complicated than a simple build/test/deploy pipeline takes an immense effort, with a range of hacks and workarounds.

Even the simplest things, like passing some data (e.g. a link) from one job to another requires quite an overhead (either using artifacts, storing it somewhere in KV or even something worse).

Moreover, .gitlab-ci.yml is one and only entry-point for the CI configuration, so everything goes into it. Yes, it does have concept of includes, but even that is quite limited and not sufficient for any reasonable workflow.

Re: In Defense of YAML

#6
post #3

> This is not structured data. This is programming masquerading as configuration I find myself expressing this same opinion to people on a frequent basis. See ansible for another big example. Ansible has a try/catch equivalent in yaml [0]! Unfortunately, YAML is more or less a lowest common denominator for these sorts of interactions - being usable from any language is a really big boon. Would love to see the world a…

What about https://dhall-lang.org/ ?

Re: In Defense of YAML

#8

You want to see a real abuse of YAML? Take a look at SaltStack's Jinja rendered YAML. I just grabbed a random forumla as an example: https://github.com/saltstack-formulas/openssh-formula/blob/m...

I don't understand why people use a markup language when they need a programming language.

I mean, sure, you can convert one into the other syntax-wise, both form trees, but what do you gain?

Re: In Defense of YAML

#9
post #3

> This is not structured data. This is programming masquerading as configuration I find myself expressing this same opinion to people on a frequent basis. See ansible for another big example. Ansible has a try/catch equivalent in yaml [0]! Unfortunately, YAML is more or less a lowest common denominator for these sorts of interactions - being usable from any language is a really big boon. Would love to see the world a…

What about https://dhall-lang.org/ ?

Dhall does indeed look like it starts to address this problem - haven't seen it before. I'd have to read deeper to decide whether I like it or not, though. I may try to convert some existing complex YAML I'm using into it to form an opinion.
Post reply on HN