3 ms·
This is exactly why TOML [0] is gaining traction as a simple configuration file format. Rust's cargo has been TOML from day one (`Cargo.toml`) and Python is mov
by japanuspus 6y ago
This is exactly why TOML [0] is gaining traction as a simple configuration file format. Rust's cargo has been TOML from day one (`Cargo.toml`) and Python is moving this way with (`pyproject.toml`).
For more general data structures, remember that JSON is a true subset of YAML [1]: Switch to a YAML parser and you can start optionally adding comments to your files while still being compatible with legacy input.
[0] https://toml.io/en/ https://toml.io/en/
[1] https://yaml.org/ https://yaml.org/
- rurban 6y agoYAML has too many features, and is entirely insecure. You really need a safe subset, as eg. used in the various CI's.
- jmillikin 6y ago> For more general data structures, remember that JSON is > a true subset of YAML [1] This is unfortunately not true -- try the input '{"a":1e2}'.
- eska 6y agoYaml is generally derided as too complex and transforming data in unintended ways. I see a lot of Rust programmers preferring RON over TOML because it is much less complex and doesn't have multiple ways to express the same thing https://crates.io/crates/ron https://crates.io/crates/ron
- bbotond 6y agoI hate YAML. XML and JSON have syntaxes that are very easy to learn. You basically see one example and know 99% of what you need. YAML has multiple ways of doing the same thing (eg. two array syntaxes) and is generally too "clean" looking to the point of being unreadable.