4 ms·
The YAML spec is huge, too large IMO for config files (you can use it while knowing only a subset, but you'll be lost as soon as someone uses a feature you don'
by pygy_ 10y ago
The YAML spec is huge, too large IMO for config files (you can use it while knowing only a subset, but you'll be lost as soon as someone uses a feature you don't know).
I think TOML strikes a good ballance between simplicity and features for config files. It ends up being easy to read and write.
https://github.com/toml-lang/toml https://github.com/toml-lang/toml
- jedisct1 10y agoNod. TOML is really nice for configuration files.
- Matthias247 10y agoI agree. You often want to parse and/or generate configuration files programmatically. For these cases it's good if parsing and interpretation of the file format can be easily implemented (or is already implemented in high quality). YAML has a quite big featureset and definitely doesn't fall into the "easy to parse" category. I'm also quite happy with using TOML for configuration files for these reasons.
- crdoconnor 10y agoI wrote a layer around an existing parser that refuses to parse anything except that subset that most people use 99% of the time: https://github.com/crdoconnor/strictyaml https://github.com/crdoconnor/strictyaml IMO TOML is syntactically messy, especially when dealing with hierarchical data, and a whole new config format to deal with the fact that YAML has too many features is somewhat unnecessary.