6 ms·
This is unquestionably hillarious, and there are for sure some questionable "features" of yaml. But all this yaml hate recently seems to be hate that would be b
by benrutter 3y ago
This is unquestionably hillarious, and there are for sure some questionable "features" of yaml. But all this yaml hate recently seems to be hate that would be better directed at the garbage CICD toolkits that come with things like github, azure dev-ops etc.
YAML is good for human readable configuration, with some notable caveats. But its terrible for being a secret programming language where the only way to execute it is to put in a PR request, commit to a live branch etc.
- oblio 3y agoWe basically need Restricted YAML. No 1000 ways to say true/false. No 1000 ways to have strings. No significant whitespace in config files (also helps out with the 1000 types of YAML strings). Etc. A subset of YAML that drops all that garbage. And yeah, the CI/CD stuff should also use... a sandboxed programming language. I think Lua and Tcl can remove functions and language constructs in a sandboxed enviroment. Pick one of those, or improve it slightly (make Lua 0-index based if you so care), and then use that.
- zufallsheld 3y agoThere already is strictyaml: https://github.com/crdoconnor/strictyaml https://github.com/crdoconnor/strictyaml
- oblio 3y agoCool, get back to me in 2040 when it's adopted by Ansible, Github Actions, Bitbucket, Kubernets & its menagerie :-p
- hahn-kev 3y agoThere's no reason you and your team couldn't choose to use it today no?
- verdverm 3y agoAre there packages for language X? How would you enforce it?
- mminer237 3y agoLooks like just Python at the moment. But you could enforce it with a pre-commit hook.
- verdverm 3y agoBut then I also have to make sure python and the dependencies are available in all the places. Not an ideal situation for git hooks. What do you do when you bump the version in one branch and then switch branches?
- cageface 3y agoSignificant whitespace is a mistake people keep making over and over again for some reason.
- hahn-kev 3y agoProbably because python is so popular
- verdverm 3y agoUse tabs to reduce whitespace chars :] I think a more precise statement is "scoping with invisible chars" Python has this issue too
- RealStickman_ 3y agoPeople should start using a good editor.
- alexvitkov 3y agosomething like JSON maybe idk
- drdaeman 3y agoYou missed the "/s" bit, I presume? But you certainly have a point. If JSON still fits somewhere - that's nice, it means the issue is just about YAML syntax (which is a matter of personal preference, really; but I thought we left all the entertainment of putting Pythonistas and Perl Hackers in a virtual ring in the past decade, somewhere next to /.'s grave). If JSON feels worse - it means YAML's syntax is not a problem, it's a symptom of YAML being misplaced to express something other than a simple data structure.
- alexvitkov 3y agoNo /s, either JSON is OK for you or it's not, and if not a slightly nicer looking but way more error prone JSON doesn't solve your problem. 1. If you're making a user-facing program you give them a nice settings menu and store the config as whatever. 2. if it's developer-targeted software, and your config starts approaching a scripting language you don't encode arbitrary computations in YAML (or XML, Microsoft), but rather let the user use a scripting language and preferably you don't invent a new one. We always cry about fragmentation and complexity in software and yet even in the rare cases when we have universally agreed upon formats/standards we will still go out of our way to make a new one for the amazing benefit of significant whitespace.
- thayne 3y ago> If JSON feels worse - it means YAML's syntax is not a problem Only if you can say the same of json5. There are plenty of cases where you have a simple data structure, but having comments and multi-line strings is important.
- drdaeman 3y agoHow's this supposed to make any difference about YAML (or this Restricted YAML) being used for things it's not supposed to be used for? It's not a problem that $CI YAML configs have multiple ways to encode strings and need indentation. Yes, "no" issue sucks a bit, but it's not that huge, just a minor papercut. The giant root issue is that YAML is simply not an appropriate format for this kind of stuff. People are writing more and more complex programs (modern CI pipeline is a program*) in it, when it's not a [suitable] programming language. And it's not suitable not because of whitespace. Syntax doesn't matter that much (unless you're a junior developer first time seeing APL - just kidding, of course), it's all about the semantics. YAML was never meant for writing programs, it doesn't have necessary constructs to support those (but people are inventing DSLs on top of it, and it looks and feels awful). Similar logic applies to some orchestration systems, some IaaC stuff and other areas where YAML is not a great fit because systems either "outgrew" simple configurations to something else (like programs, but not always) or YAML was a bad fit from the very beginning. CI is just the most obvious example. *) It made sense when CIs were simple, and those YAML files were configuration snippets rather than programs. Just like Makefile makes a lot of sense, when it's able to do all you need. But CI grew more and more complicated.
- nunez 3y agoI agree; it's annoying that Big CI/CD decided to make YAML the standard for declaring pipelines. YAML is so friggin fragile!
- JeremyNT 3y ago> YAML is good for human readable configuration, with some notable caveats. But its terrible for being a secret programming language where the only way to execute it is to put in a PR request, commit to a live branch etc. Bingo, people keep implementing incredibly complex DSLs that are based on YAML, and users keep shoving more complexity into that YAML since it's the only tool they have to interface with $THING, and all of a sudden nobody can comprehend what is actually going on just by reading it. It's not a problem of YAML per se (another format would just have its own footguns / pain points), it's a risk with any DSL: you can create something so complex that it's actually less clear and harder to manage than it would have been with a normal programming language from the start.
- hk1337 3y ago> users keep shoving more complexity into that YAML since it's the only tool they have to interface with $THING, and all of a sudden nobody can comprehend what is actually going on just by reading it. code monkeys do that. I like YAML for exactly what you describe but people abuse it then complain it sucks.
- nerdponx 3y agoIt's not even funny. # Doing the same thing with different CI providers Ha ha clown emote means I smart u dum! Guess what: this is just an interface, everyone does everything differently in every language/format no matter what. This is Reddit-level junk humor made by someone with more arrogance than sense. I flagged it.
- seanc 3y agoEvery format for 'human readable configuration' is on a slippery slope to becoming a secret programming language. "You know what would be great? A conditional statement of some kind. That would be super handy."
- dfaiv 3y agoAre there any non-garbage CICD toolkits? I've been looking at JetBrains Space Automation which uses a Kotlin DSL - is that any better?
- shykes 3y agoI’ll throw my hat into the ring… We are making dagger.io to solve this exact problem.
- shykes 3y agoI agree, as the maker as a tool that lets you program your CI with a real language instead of a terrible DSL, our first instinct was to bash YAML itself for cheap marketing points, but what you’re saying is exactly right: YAML is not perfect but it gets the job done, as long as it’s the right job. Pseudo-programming a CI pipeline is decidedly not the right job.
- MrPatan 3y ago> YAML is good for human readable configuration Not for me it's not.
- deleted 3y ago[deleted]