Re:A developer goes to a DevOps conference
by xpe on Sunday September 29, 2019 @03:28AM
(#21105655)
I recommend taking a look at TOML [1] as an alternative to YAML for many situations.
Objectives:
TOML aims to be a minimal configuration file format
that's easy to read due to obvious semantics. TOML is
designed to map unambiguously to a hash table. TOML
should be easy to parse into data structures in a wide
variety of languages.
A reddit thread titled "YAML vs TOML" has some merit [2].
YAML downsides:
- Implicit typing causes surprise type changes. (e.g.
put 3 where you previously had a string and it will
magically turn into an int).
- A bunch of nasty "hidden features" like node anchors
and references that make it look unclear (although to
be fair a lot of people don't use this).
TOML downsides:
- Noisier syntax (especially with multiline strings).
- The way arrays/tables are done is confusing, especially
arrays of tables.
Rust uses TOML to configure its build system, Cargo [3].
[1]: https://github.com/toml-lang/toml
[2]: https://www.reddit.com/r/devops/comments/6f82nu/yaml_vs_toml...
[3]: https://doc.rust-lang.org/cargo/getting-started/first-steps....