TOML sucks for list of tables simply because they intentionally crippled inline tables to only be able to occupy one line. For ideology reasons ("we don't need to add a pseudo-JSON"). Unless your table is small, it's going to look absolutely terrible being all crammed into one line.
I would still reach for TOML first if I only needed simple key-value configuration (never YAML), but for anything requiring list-of-tables I would seriously consider JSON with trailing commas instead.
I see the point and this is certainly a drawback of TOML but for me this is something of a boundary case between configuration and data.
When configuration gets so complicated that the configuration starts to resemble structured data I tend to prefer to switch to a real scripting language and generate JSON instead.
TOML sucks for list of tables simply because they intentionally crippled inline tables to only be able to occupy one line. For ideology reasons ("we don't need to add a pseudo-JSON"). Unless your table is small, it's going to look absolutely terrible being all crammed into one line.
https://github.com/toml-lang/toml/issues/516
The official way to do list of tables is (look at how much duplication there is)
vs
I would still reach for TOML first if I only needed simple key-value configuration (never YAML), but for anything requiring list-of-tables I would seriously consider JSON with trailing commas instead.
I see the point and this is certainly a drawback of TOML but for me this is something of a boundary case between configuration and data.
When configuration gets so complicated that the configuration starts to resemble structured data I tend to prefer to switch to a real scripting language and generate JSON instead.
Expression languages like Nix, Jsonnet, Dhall, and Cue are really nice in these situations.
for this reason I couldn't see a CI platform ever seriously consider TOML
(someone may point out to me a CI platform that relies on TOML—which I welcome)
Rust is built on TOML. For better or worse.
2 replies →
> JSON with trailing commas
JSON5?
It's perfect until you do a lot of nesting..
...or any nesting. TOML sucks for anything non-trivial.
It makes me sad every time I see a newly announced tool that went for YAML instead of TOML.