4 ms·
I've been using HOCON for years. Why it's not JSON: * includes * substitutions Why it's not YAML: * less confusing syntax (e.g. `cannot do that` doesn't ne
by paulddraper 10y ago
I've been using HOCON for years.
Why it's not JSON:
* includes
* substitutions
Why it's not YAML:
* less confusing syntax (e.g. `cannot do that` doesn't need quotes, but `can't do that` does)
* built-in support for overrides via env variables
Why it's not JSON or YAML:
* Built in durations! No more head scratching to figure out if 5 is seconds or milliseconds. It's just `5s`.
---
JSON is a data transfer format. YAML is a markup language (or it claims to be...).
HOCON is a composable configuration language. You always need to change, override, and deduplicate configuration in sensible way, in dev, in production, machine-by-machine.
Despite a wart or two I think HOCON takes a sensible to this ubiquitous problem.
- kingbirdy 10y agoYAML isn't a markup language, and it doesn't claim to be. The name stands for YAML Ain't Markup Language.
- keville 10y agoExcept it originally stood for "Yet Another Markup Language"[1], and the newer name only means to separate it from HTML and other document-oriented markup languages. [1] http://yaml.org/spec/history/2001-08-01.html http://yaml.org/spec/history/2001-08-01.html
- cowardlydragon 10y agoEh, probably because XML was so prevalent when YAML came out, and the fact that XML in most programmatic contexts was just a serialized tree data structure, not a "semantic document" using "markup".
- kingbirdy 10y agoAh, I wasn't aware of the old name, thanks!
- paulddraper 10y agoAh, I hadn't heard of the retcon :) It was oirignally Yet Another Markup Language http://yaml.org/spec/history/2001-12-10.html http://yaml.org/spec/history/2001-12-10.html That's why it's YAML, not AAML, BAML, CAML, etc. In any case, yaml.org currently describes it as "human friendly data serialization". I don't think YAML is a bad choice, but HOCON's explicit focus on configuration yields some nice benefits.