Good question. Here are my thoughts on all of the options you've listed:

JSON: The first versions of Heka used JSON as the config language. JSON is reasonably human-readable, but I find it pretty annoying to have to write by hand. No single issue is a deal-breaker, it's more of a "death by a thousand papercuts" experience. It's fiddly about commas (i.e. trailing commas not allowed). You have to type a lot of superfluous characters. Escaping strings for regular expressions is painful.

INI: INI format doesn't support nested sections.

YAML: YAML would probably be my next choice after TOML, but I still find it a bit more fiddly. It's a much more complicated format. Nesting depends on matching indentation. Like JSON, it was designed as a data serialization format, not really configuration.

TOML: TOML came out just at the time we were realizing that JSON was going to be painful to work with, and we though it was hitting on the right idea for a config format: INI plus nesting. Simple to write, simple to read. There was a Go implementation from the beginning. We tried it out, it fit in easily, it's worked w/ little trouble, so we've been happy with it.

The only thing we don't like about TOML is that it also makes escaping regular expression strings painful. We opened a ticket on this against the TOML spec over a year ago (https://github.com/mojombo/toml/issues/188). We've routed around that by implementing our own fork that supports the "raw strings" extension (https://github.com/bbangert/toml). A bit messy, perhaps, but all in all it's working so we're not really inclined to invest our resources in switching to another format.

Hope this helps,

-r


On Wed 30 Apr 2014 02:03:35 AM PDT, Victor Castell wrote:
Maybe it's a dumb question or it has already been answered but why use
TOML as the configuration format?

I have nothing against TOML as a concept but it's spec it's still
changing a lot (as it says), it's not as "standard"/widespread/known
as JSON/YAML/INI that serves equal for this purpose, or I'm wrong?

_______________________________________________
Heka mailing list
[email protected]
https://mail.mozilla.org/listinfo/heka

Reply via email to