Re:Typed Config Languages
by darthrupert on Saturday January 22, 2022 @05:26AM
(#30035409)
Yep. YAML especially is just horrifying to use unless you have internalized how lists and dicts work. After 5ish years of working with YAML files, I haven't.
TOML is an excellent contemporary choice that is not unpopular. HCL might be another, but unfortunately not very popular outside Hashicorp tools.
If you now add an invisible type layer on top of them, it doesn't get better, it actually gets worse. Now the interpretation of a value in the file not only depends on the literal interpretation by the human brain but on some type definition one needs to be aware of, adding a semantic interpretation that can be non-obvious. That is why we have micro-formats: they are obvious (mostly). http:// 03-13-1980 123e4567-e89b-12d3-a456-426614174000 "I'm a string"
There's a delicate balance between readability and correctness and safety. YAML et. al. are not hitting that balance.
And if you really, constantly, need to edit config files and can't handle a format that prioritizes correctness over readability: Build a UI.