4 ms·
We do, it’s called TOML. The future is here it’s just not equally distributed.
by zarzavat 5y ago
We do, it’s called TOML. The future is here it’s just not equally distributed.
- Tesl 5y agoIt's perfect until you do a lot of nesting..
- donio 5y ago...or any nesting. TOML sucks for anything non-trivial.
- 41b696ef1113 5y agoIt makes me sad every time I see a newly announced tool that went for YAML instead of TOML.
- SPBS 5y agoTOML 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 https://github.com/toml-lang/toml/issues/516 The official way to do list of tables is (look at how much duplication there is) [[main_app.general_settings.logging.handlers]] name = "default" output = "stdout" level = "info" [[main_app.general_settings.logging.handlers]] name = "stderr" output = "stderr" level = "error" [[main_app.general_settings.logging.handlers]] name = "access" output = "/var/log/access.log" level = "info" vs handlers = [ { name = "default", output = "stdout", level = "info", }, { name = "stderr", output = "stderr", level = "error", }, { name = "access", output = "/var/log/access.log", level = "info", }, ] 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.
- bin_bash 5y agofor 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)
- colejohnson66 5y agoRust is built on TOML. For better or worse.
- notriddle 5y agoDo you mean Cargo? Because Cargo is not a CI system. You never embed shell commands in a Cargo.toml. If you need to program complex logic to build a crate, you don’t write TOML. You write a build.rs file in actual Rust.
- Too 5y agoIf embedding shell commands in a configuration language is considered a CI system I think we are doomed.
- zarzavat 5y agoI 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.
- CameronNemo 5y agoExpression languages like Nix, Jsonnet, Dhall, and Cue are really nice in these situations.
- Dylan16807 5y ago> JSON with trailing commas JSON5?