Lua was designed to be an extension language though (checked on wikipedia this time :-D)
—PEP 8
They got more strict about booleans. For those who need/want the old behavior, ALLOW_BROKEN_CONDITIONALS can be set in the ansible.cfg or `is truthy` can be used for python-like version, but it becomes explicit vs being implied.
You are literally one missing tab away from breaking your entire configuration file. Yet the industry keeps pushing it for the sake of “simplicity” - for small configurations sure, it’s fine, but many hundred lines of config entries? Good luck fixing it, if something goes wrong.
I still can’t get why software engineers suddenly started to hate XML.
The only thing I wish it had is @import-s from a separate files, that way we could split local/checkedin configs. YAML doesn't have @imports as well (only rudimentary from the same file), I have only seen them at HOCON.
Imagine Yaml only in the editor. but stored (and code reviews consequently) are .property style.
I personally think the best is one of the humanized json ones like https://maml.dev/
<project>MAML</>
<tags>
<item>minimal</>
<item>readable</>
</>
<!-- A simple nested object -->
<spec>
<version>1</>
<author>Anton Medvedev</>
</>
<!-- Array of objects -->
<examples>
<item>
<name>JSON</>
<born>2001</>
</>
<item>
<name>MAML</>
<born>2025</>
</>
</>
<notes>
This is a multiline raw strings.
Keeps formatting as-is.
</>Ultimately, what matters is the editing mode and not the data format. Good syntax highlighting and autocompletion goes a long way towards safely editing structured text, regardless of on-disk format.
Which is really all we ever needed.
I still see that better than YAML's indentation problem. Relying solely on indentation is a nightmare.
Not if you use the "flow" style. The "flow" style makes the syntax almost tolerable. But, if you do that:
a) You don't get to use all of YAML. I remember that the '|' construction could not be used, and I believe that there was at least one other feature that was unavailable.
b) Get ready to get turbofucked when some YAML-handling library writes out your config file in "block" style, putting you right back in Indentation Hell.
After having worked with both professionally for many years, I'd say that I hate JSON and YAML just about equally.
In JSON, you’re one curly brace away from breaking your entire configuration file. How is that different?
<strike>Ask me how I know.</strike>
[0] sections? snippets? fragments? Hopefully you get what I'm trying to say here.
Yes, but I don’t just randomly perform the operation when I don’t want to change the indentation.
> Separate from that, have you never fat-fingered the tab, space, backspace or delete keys?
When I’m in insert mode, I look at what I’m writing, so I immediately undo any such accidental edit. Outside insert mode, it’s hard to accidentally change indentation.
> Never deleted one too many whitespace tokens when cleaning up an inadvertent or misdirected paste?
I use indentation-preserving paste, so… no?
Well, I'll likely be long dead once time's erosion of your body's self-repair machinery has destroyed your ability to be The One. Given that, please do accept this package containing my condolences for your loss. Time's insults are profoundly cruel and unjust.
Isn't this true for Python, too?
Python's whitespace-defines-scope syntax is the reason I won't use it unless I have no other choice. If it weren't for that -IMO- extremely poor design choice, I'd consider it to be a decent language. [0]
[0] Yes, some people think this feature of Python is fine. I'm not one of them. Whether or not you think this feature is fine is a matter of taste.
One workaround is to escape the string, like this:
countries:
- DE
- FR
- "NO"
- PL
- RO
Comon, it’s 2026, yeah yaml’s design can lead to odd type casts, but a whole essay on this? Keep it under 140 chars pls.I have doubts about the over all utility of yaml. I am not sure how readable it is over well formed json. and my main exposure to it is ansible which suffers from the inner platform effect where in order to save us from programming a programming language is jammed into a non programming language(usually XML but in this case YAML) and every one is more miserable for the experience. But complaining about a thing that is fixed is wierd.
I find even plain json easier to write than yaml. Especially when you factor in the scope of mistakes. Tiny mistakes can completely break the structure of a yaml document in ways that are still valid yaml. With json I'll catch that because auto-indenting will follow the actual structure
It's been 10 years, if not more, since I've seen YAML configuration files using "yes/no" or "on/off". Even back in the day, these alternative boolean values were never extremely popular: the community more or less settled on true/false.
The libraries issue is real, but my issue is with the word "popular". These are libraries that used to be very popular, and kinda stuck on as the default, even though most of them semi-abandoned and (at least in my opinion) shouldn't really be used by any new project.
PyYAML's last major release was in 2021, and it's only seen security fixes since then. Even the last major release in 2021 was only a major release becasue Python 2.7 support was removed. Before that there were some API changes in 5.1 released in 2019 (only because the PyYAML defaults have been ridiculously insecure and everyone has been complaining about this for years), and between 2008 and 2019 there were barely any worthwhile changes. tl;dr: PyYAML has been in maintenance mode since 2008.
Libyaml (which PyYAML is based on) hasn't seen a new release since 2020, and while it introduced some YAML 1.2 support, the development pace on this library has been glacial since 2009. Between 2009 and 2020, the project had 3 commits touching actual code per year on average, and since then the number went down to 1 commit on average.
It's a sad state that both libyaml and PyYAML are part of the official YAML project, but hasn't budged forward in supporting YAML 1.2. There is something to be said about open-source project being feature complete and requiring only light maintenance, but if they don't support the latest major YAML spec version that was released all the way back in 2009, I don't think we can call them feature-complete.
There are newer libraries out there for all these languages that support 1.2, are more well-maintained and often offer better and safer API, like libfyaml for C, yaml-cpp for C++, ruaemel for Python and goccy/yaml for Go (not the same as the original go-yaml, does support most of YAML 1.2, but has strangely chosen to keep the "Norway booleans").