this post was submitted on 14 Jan 2025
318 points (92.1% liked)
memes
10922 readers
3212 users here now
Community rules
1. Be civil
No trolling, bigotry or other insulting / annoying behaviour
2. No politics
This is non-politics community. For political memes please go to !politicalmemes@lemmy.world
3. No recent reposts
Check for reposts when posting a meme, you can only repost after 1 month
4. No bots
No bots without the express approval of the mods or the admins
5. No Spam/Ads
No advertisements or spam. This is an instance rule and the only way to live.
Sister communities
- !tenforward@lemmy.world : Star Trek memes, chat and shitposts
- !lemmyshitpost@lemmy.world : Lemmy Shitposts, anything and everything goes.
- !linuxmemes@lemmy.world : Linux themed memes
- !comicstrips@lemmy.world : for those who love comic stories.
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Eh....
I guess yaml is fine.
I hate the significance of whitespace, and the fact that I cannot find any editor that can auto-format. Which are both related, I guess: there is no way to know a yaml document is actually correctly formatted without knowing the intended schema.
Whereas JSON doesn't have this ambiguity. But JSON has it's own drawbacks.
YAML is fine as a configuration language and ok data input language.
YAML is absolutely cursed as a programming language. As in Ansible has created a really shitty programming language inside of YAML. Should be burned with fire.
Reminds me of AutoHotkey
AHK grammar is a fucking mess, honestly.
I guess it's like HTML if it tried to also adopt it's own scripting language. Whereas JS interacts with the HTML DOM. Sure, it has quirks, but essentially modified a config.
I've never found a nice way writing YAML with variables and configurability.
Trying to use yaml to natively describe how a yaml config should be produced is broken. It diverges from the underlying schema, and (because it's
.yaml
) isn't distinguishable from any other yaml.Things like helm treat yaml as a template. And I don't think language servers & tooling are up to scratch yet (happy to be corrected). So basic yaml formatters shit the bed.
Yaml is a computer readable config file that tries to be human readable, and fails at being actually useful.
Why projects try and make it useful, I will never understand.
I honestly think generating yaml from something like python would be a million times easier.
But then tools like ansible adopt yaml to essentially be a scripting language. As opposed to creating an actually decent solution that uses both python (to generate) and yaml (to apply).
Or whatever language.
I kinda like YAML for simple configuration files, but the YAML spec is borderline insane.
https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-from-hell
And don't get me started with ansible, it never works the way I think it should and almost every playbook or role I write is a pain to get right. When it works, it's a really nice tool and I couldn't manage my homelab as efficiently without Ansible, but it frustrated the hell out of me way too often.
I feel I spend more time iterating yaml.
There isn't any tooling that actually helps you write it.
I feel like there is a gap in the market for a solution that uses typescript, typed python or some other type-able scripting language, which then generates the yaml files.
A language that has language servers, intellisense, all the modern dev tools. Schemas are provided as simple type descriptors. And whatever script you write then produces the correct result.
Some sort of framework on top of that to provide an opinionated workflow, and some tooling to lint/validate/produce.
And the result is yaml files which can be checked/diffed against in-place config, and version controlled for consistency.
You mean like ansible-lint or yaml-lint?
Are you looking for an editor that can format YAML out-of-the-box or with plugins? In my experience, most editors only support a small number of formats out of the box and extend that functionality with plugins. I have yet to find a solid, production editor without a decent YAML formatter. If you’re using one of the common commercial ones, Red Hat maintains many that work explicitly for Ansible.
XML master race
XML is extremely verbose.
Again, requires some other tooling to generate (I feel I can point to JavaScript for an example of XML manipulation)
What's funny is that if you use attributes a lot then XML can be about the same size as JSON. But people think there are things you should and shouldn't use attributes for for some reason. The only thing XML has going for it is a really nice schema format, but even today that's pretty moot. JSON schema and others are pretty well supported.
Yeah, reading XML without rendering it or at least with syntax highlighting is a pain.
JSON is way nicer.