I made the mistake of reading the Hacker News comments on this story:
Depending on how well that user knows OpenBSD, this question may in fact be a good one:
Why use a yet another different text format for configuration instead of JSON/XML/YAML/TOML? OpenBSD tools such as pf, OpenSMTPd and the new httpd (others? I’m not familiar enough) actually share the same syntax, so learn one, be comfortable in the others.
Why use a configuration language instead of a programming language? Though Turing-complete languages have proven themselves useful in the configuration of many applications (e.g. Emacs, Xmonad), they can be sometimes overwhelming for non-programmer users and a simpler language actually is a feature.
Not really a reply, but I’d like to add to that:
JSON and XML are bad configuration languages. The other two have issues.
a) Comments are inconvenient (XML) or not possible (JSON)
b) Both make the “adding a line” hard - JSON because of its hash syntax that requires “,” after every line except the last, making “growing the config” hard. XML because of its general verbosity.
c) Generic data formats as they are, they often don’t check for options that are not valid, encouraging misconfiguration through typos. (XML as it should be used being an exception)
I like YAML, because it has references, but there are also surprising parts in that language. Also, I find checking of validity hard. Also, there are at least two styles for everything ;). I see why people don’t like it.
I don’t like TOML that much - it has many of the issues mentioned in c) and some of the “there are two ways of writing things”. Also, I have no mental mapping between what I wrote in TOML and the actual configuration key in the software in the end.
Both make the “adding a line” hard - … XML because of its general verbosity.
I don’t see why verbosity makes adding a line hard. I think xml is a great choice. It can be easily validated on any platform with xsd, and re-rendered if desired with a number of techniques.
json doesn’t support comma after the last element?
Like Scons, which substitutes Makefiles for python code? It’s an utter disaster of undocumented time suck.
Well, I see the point, but once you start building Makefiles using autotools, you are in a mess of undocument time suck in M4.
Slides are available here : http://www.openbsd.org/papers/httpd-slides-asiabsdcon2015.pdf
Looks like httpd doesn’t support setting headers yet – would love to give it a try again if/when it does though.
Yep. It works for my use case of serving static files. Haven’t had problems.