109 ms·
I agree that less power is better, but I find TOML pretty cryptic. Like I said, JSON with comments and multi line strings is my ideal. :)
by weberc2 7y ago
I agree that less power is better, but I find TOML pretty cryptic. Like I said, JSON with comments and multi line strings is my ideal. :)
- yellowapple 7y agoWhat do you feel is cryptic about TOML? I always felt it was pretty straightforward, especially if you're coming from INI (you could feed INI files into a TOML parser and most of the time end up with something somewhat sane, especially if you're using octothorpes instead of semicolons as comments). That aside, I'm personally a big fan of using Tcl-like / shell-like syntax for configuration, since it enables some pretty rich and expressive config directives while not being insanely verbose like most attempts at using XML for this. It's one of the things I really like with OpenBSD's various subprojects like PF¹ and OpenSMTPD² and relayd/httpd³, and I'm semi-actively working on a way to do similar things in Erlang/OTP applications⁴. The only alternative that matches that level of expressiveness (besides just doing all configuration directly in the host language) is s-expressions. ¹: https://man.openbsd.org/pf.conf https://man.openbsd.org/pf.conf ²: https://man.openbsd.org/smtpd.conf https://man.openbsd.org/smtpd.conf ³: https://man.openbsd.org/relayd.conf.5 https://man.openbsd.org/relayd.conf.5 / https://man.openbsd.org/httpd.conf.5 https://man.openbsd.org/httpd.conf.5 ⁴: https://otpcl.github.io https://otpcl.github.io
- weberc2 7y agoI'm not coming from INI files. :) I actually always felt they did a poor job of representing anything more than key value pairs and they weren't standardized, so I always managed to avoid learning the grammar(s). I'm sure if I put much effort into it, I could figure out TOML, but I don't want to ask my users to figure out yet another configuration language. If I'm going to make them learn another configuration language, it's going to have something more to offer than just 'simpler than YAML'. Maybe Starlark for more powerful configuration applications (think infra-as-code where YAML/JSON/etc clearly isn't powerful enough) or if someone ever builds it, "JSON with comments and multiline strings" which offers simplicity without compromising familiarity. Actually, it would be really interesting to hear what people's ideal configuration languages would look like. > That aside, I'm personally a big fan of using Tcl-like / shell-like syntax for configuration, since it enables some pretty rich and expressive config directives while not being insanely verbose like most attempts at using XML for this. I'm not really familiar with this. I'll have to read up.
- com2kid 7y agoTOML is what I'd naturally write as notes if I wanted to document how something is working. YAML is all sorts of strange. JSON needs comments and support for trailing commas. Since that isn't going to happen.... TOML!