Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I always felt Yaml is far too complicated of a format for storing hierarchical data. JSON is too simple (no comments; hard to store multi-line strings).

HCL, the hierarchical data storage language used by Terraform, is the closest thing I’ve seen to a happy medium between JSON and Yaml.

Another option, if the string values are not multi-line, is CommentJSON (use the Python module or write 10 lines of code that strips out comments from JSON if using another language).



Both a bare > and a sequence of 3 quotes are invalid in JSON, so it should be really simple to add multi-line strings wither Python or Perl style.


The Hjson format does this: https://hjson.org/. It’s just JSON plus syntax sugar such as // comments and '''multiline strings'''.


    {"comment": "JSON supports comments just fine. :-)"}




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

Search: