Underrated perk of JSON: it's easy to programmatically make changes to a file made by a human.
Very few other formats have this advantage. `cargo add` took a bunch more implementation work than `npm install`, because preserving TOML comments takes more work.
Related Posts
One nice feature of cargo that I wasn't previously aware of: you don't need to do anything after updating your Cargo.toml.
In npm, you need to remember to `npm i` after changing package.json. It's not declarative and the state can get out of sync.
ASTs typically discard comments, and that's usually what you want.
The only time (AFAICS) that preserving comments is useful is for writing a code formatter.
Could you write a formatter in terms of a list of lexemes? A CST is a non-trivial bit of code for one use case.
Delighted to see that TOML has released a new version! TOML is overall a great standard but I understand they had limited people with the power to cut a new release.
https://github.com/toml-lang/toml/releases/tag/1.1.0