Hacker News new | past | comments | ask | show | jobs | submit login

Toml would be the best choice IMO



TOML is syntactically noisy and about 50% more verbose.


I'm not sure how

    [general]
    foo = bar
is 50% more verbose than

    { "general": { "foo": "bar" } }
But also it's significantly more human-readable (and critically, it's much more human-writable).


It starts to get more verbose when you have more keys and deeper indentation since the whole hierarchy is repeated for each key e.g. [general.foo.bar.bar].

JSON wasn't intended for maximal human readability/writability like CSON/YAML were. It was intended first and foremost as a simple data transmission format.


Large hierarchies are always difficult in plain text formats. I'd argue if you need the user programming the config to understand a large hierarchy then you've already got a problem.


By large I mean two/three levels and above. Nothing's perfect but YAML does that fairly well (e.g. ansible playbooks)

TOML handles anything three levels or above in a less readable way than indented JSON (which doesn't even prioritize readability).

It looks find provided you're only dealing with tiny ultra simple config files.


   [foo.blah.bee]
   hi = 4
seems readable enough.


GRON and KVIN are better because: (1) I wrote KVIN as a long term joke to give my boss a stroke; and, (2) I like GRON’s author’s style.

KVIN: https://github.com/jaroslov/kvin

GRON: I can’t find the spec; sorry.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: