>
I removed comments from JSON because I saw people were using them to hold parsing directives, a practice which would have destroyed interoperability.I call BS. If people want to have custom parsing directives they can send them out of band, encode them in the filename, or whatever. But they don't. And I've not seen this happening with most other serialisation formats either, so why would JSON be a particular target? After all it's value comes from being trivially parsable across languages, and that would be killed by custom parsing directives. Those wanting those would also implement their own parsers etc.
Addition: Besides, reading comments to decide how to parse, implies either "comments on top of the file" or a "2 stage parsing".
With 2 stage parsing, you could implement comments and whetever else yourself, even in pure JSON anyway.
As for "comments on top of the file", well, just disallow them (only allow comments after the first JSON object starts), and no issue with "parsing directives" anymore...
I call BS. If people want to have custom parsing directives they can send them out of band, encode them in the filename, or whatever. But they don't. And I've not seen this happening with most other serialisation formats either, so why would JSON be a particular target? After all it's value comes from being trivially parsable across languages, and that would be killed by custom parsing directives. Those wanting those would also implement their own parsers etc.
Addition: Besides, reading comments to decide how to parse, implies either "comments on top of the file" or a "2 stage parsing".
With 2 stage parsing, you could implement comments and whetever else yourself, even in pure JSON anyway.
As for "comments on top of the file", well, just disallow them (only allow comments after the first JSON object starts), and no issue with "parsing directives" anymore...