3 ms·
I thought TOML was nice until I tried writing a parser that handled nested tables. There's very little convergence between libraries because it's such a hard /
by hombre_fatal 4y ago
I thought TOML was nice until I tried writing a parser that handled nested tables. There's very little convergence between libraries because it's such a hard / ambiguous problem.
I thought I was making good progress until I tried burntsushi's edge case test suite. It reminded me of implementing YAML.
TOML is slightly nicer to write than JSON if your structure is flat, like a php.ini or Cargo.toml file. Other than that, I prefer the simplicity of JSON as well as the buy-in of JSON Schema support in apps like VS Code.
We too often do this thing as craftspeople where we dramatize how much minor pain points impact our lives while ignoring the upsides.
- est31 4y agoI agree that nested data is a weak point of TOML. But writing TOML files that don't have huge levels of nesting is a charm, which would be precisely the place where php.ini, Cargo.toml and package.json operate in. Deno had the chance to innovate here, but they missed out on it.