3 ms·
Toml has unlimited nesting as well. There are also many formats that are "better json" that have comments, multiline strings, trailing commas etc. Such as hjso
by thayne 5y ago
Toml has unlimited nesting as well.
There are also many formats that are "better json" that have comments, multiline strings, trailing commas etc. Such as hjson, json5 (and variants such as json6, jsonX, etc.) and hocon. As well as more sophisticated languages like jsonnet, dhal, and cue.
Many of these can be "compiled" to JSON.
There is plenty of competition, but for some reason, YAML seems to be the most popular.
- fanf2 5y agoTOML gets very weird as soon as you have more than one level of nesting.
- thayne 5y agoNesting multiple levels of tables is pretty simple, you just have sections that look like [a.b.c]. It's different than Json, but IMO easier to read and navigate. Unfortunately it doesn't handle c arrays of arrays of tables very well.
- dathinab 5y agoIt depends on the kind of nesting, cargo has multiple levels of nesting all the time and it's working well. Through is you have thinks like object->list->object->list thinks can get weird without questions. Still most time I had such complex configs I also often (not always) realized that I did something wrong and unnecessary complex...