2 ms·
I feel like there's still not enough people that hear this, so I'm repeating it: YAML is not a programming language, or a configuration language. It is a data
by 0xbadcafebee 5y ago
I feel like there's still not enough people that hear this, so I'm repeating it:
YAML is not a programming language, or a configuration language. It is a data serialization language. Biiiig difference.
YAML is not an interface any more than a CSV file is an interface. But if it were an interface, it's not a good one for humans. It's read-only for humans, and sometimes not even read-only for machines, as different parsers can result in problematic behavior.
YAML is not a "lingua franca" any more than the Latin Alphabet is a "lingua franca". Just because you can represent information using one written form doesn't mean two different subjects understand what each other are saying.
If you want a program (not a human) to save and load configuration, and require preserving data types and including triggers and templating, YAML is great for that. However, if you just want to save random key-value strings, JSON is simpler, and thus better. If Pulumi really wanted "the simplest, most broadly understandable and recognizable, and easiest to generate option", they should have gone with either JSON or INI.
When you start "extending" your YAML to include interpolations ("${ .. }"), now you've gone and started inventing a shitty programming language. Do not fall into that trap! Either process the entire file with a templating/preprocessing engine, or don't do interpolations or logic at all. Either write a language or serialize data. Do not conflate the two!! It's not that hard to write a real language parser anyway!