[0]: https://github.com/DaveJarvis/keenwrite/blob/master/docs/scr...
[1]: https://youtu.be/u_dFd6UhdV8?t=160
11–20 of 96 posts
[0]: https://github.com/DaveJarvis/keenwrite/blob/master/docs/scr...
[1]: https://youtu.be/u_dFd6UhdV8?t=160
If the configuration needs to be transformed into a more computer-friendly format like json or yaml for later loading by a binary, that's easy enough to do at build time in a modern-ish build system like bazel
There are a variety of generic DSLs for encoding configuration concisely with composability, functions, custom validation, etc. Some examples would be jsonnet, dhall, and cue. If the configuration needs to be transformed into a more computer-friendly format like json or yaml for later loading by a binary, that's easy enough to do at build time in a modern-ish build system like bazel
TOML makes it more trivial to associate comments with a node. This is mainly because the language is simpler though, as the spec is not explicit about that (https://toml.io/en/v1.0.0#comment).
Hm. I can see where the article is coming from. Some configuration files grow beyond classical configuration and end up being more like programming. With configuration being "Put the right connection / path strings into the program, enable some subsystems/feature toggles" and programming being along the lines of, e.g., arbitrary metric transformations in a metric collector, or programmable ACLs. With some systems, I…
yaml adds to that comments and a pleasant readable layout, even if it requires a little bit more from the editor to make it pretty.
With that, I don't think yaml has much competition.
The solution for defining a more complicated config is to write your own config file format? I would think a custom format wouldn't necessarily be easier for others to read and write unless it came with a guide/readme, but then that's just one more thing to learn. Admittedly, I've never had to write a super complicated config file, but can anyone tell me why I shouldn't continue to use something like JSON for all of…
Compared to yaml or ini formats, JSON is arguably harder to read and definitely harder to write due to having to keep track of brackets, commas, and/or quotes. Ideally, a configuration file should be easy to read and write/modify by a user of the application. A lot of applications just stick with ini like formats because it meets both requirements.
If anything, YAML is harder to read because the indentation is important, yet deliberately invisible.
I don't know what a better alternative is but yaml can be incredibly frustrating.