4 ms·
JSON + comments + trailing commas + naked keys + multiline strings would be a great alternative. Maybe something like JSON5.
by ngrilly 8y ago
JSON + comments + trailing commas + naked keys + multiline strings would be a great alternative. Maybe something like JSON5.
- kodablah 8y agoYou'd really like HOCON[0] then. Just a bit too complicated to see wide adoption I'm afraid. 0 - https://github.com/lightbend/config/blob/master/HOCON.md https://github.com/lightbend/config/blob/master/HOCON.md
- ngrilly 8y agoInteresting, but, as you wrote, it's a bit too much complex, and there is too much syntactic variations for my taste.
- rad_gruchalski 8y agoHOCON is awesome
- krapp 8y agoHave you considered Lua tables? The syntax resembles JSON, but simpler, and keys don't need to be quoted. Trailing commas are allowed, and so are multiline strings.
- ngrilly 8y agoI didn't have. But how do you parse it without Lua? Is a parser library available for mainstream languages?
- krapp 8y ago> But how do you parse it without Lua? You wouldn't, but the language is lightweight enough (according to Wikipedia, the interpreter is ~180kb compiled) that including it as a dependency probably won't matter. It's less overhead than an interpreter for JSON or YAML at least. >Is a parser library available for mainstream languages? It's used commonly in game development so yes for C and C++, and the site[0] mentions "Java, C#, Smalltalk, Fortran, Ada, Erlang, and even in other scripting languages, such as Perl and Ruby" as well. [0]https://www.lua.org/about.html https://www.lua.org/about.html
- user5994461 8y agoSee https://hjson.org/ https://hjson.org/ too. Same as json5 except it has libraries in all languages, examples and unit tests.