3 ms·
I'd say that was exactly backwards. The reason JSON succeeded is precisely that it is a very, very specific standard. You may still be operating under the commo
by jerf 12y ago
I'd say that was exactly backwards. The reason JSON succeeded is precisely that it is a very, very specific standard. You may still be operating under the common misunderstanding that JSON is just "Javascript object notation", but in fact it is a carefully chosen and very rigid subset. It is actually illegal to not use double-quotes to identify a key, even though in Javascript itself often no quotes are required, and apostrophes are accepted as quotes. JSON's human-readability is a bit deceptive... it is also a very rigid format.
And it is precisely this rigidity that led to its success. There's a tons of other things that existed before JSON, and JSON won, and it's hard not to read the fact that the very looseness of its competition, which the designers of those formats perceived as strengths, were also weaknesses. Any slight little corner in a spec where there can be a divergence of opinion, there will be divergence of opinion when being implemented dozens of times. So having the spec be rigidly precise was a key advantage for JSON.
Which, incidentally, means HJSON's competition isn't JSON. This is why everyone here is talking about YAML, and the other such languages. And that's a rich, established field with probably no room for a new language to emerge.
HJSON's only hope would be to have a mode where it could be trivially compiled to real JSON, where it could work like a dialect. Unfortunately it's promise to round-trip comments wrecks that ability.