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.
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.
code monkeys do that.
I like YAML for exactly what you describe but people abuse it then complain it sucks.
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.
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.
I think a more precise statement is "scoping with invisible chars"
Python has this issue too
How would you enforce it?
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.
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.
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.
"You know what would be great? A conditional statement of some kind. That would be super handy."
Not for me it's not.
# 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.