News for hackers. Stuff that matters.
Re:JSON5 is a proposed extension to JSON by georgewfraser on Saturday March 01, 2014 @06:18PM (#7326636)
Json originally had comments, they were intentionally removed:

https://plus.google.com/app/basic/stream/z12ztpczbxrdglfgl04...

Re:JSON5 is a proposed extension to JSON by swift on Saturday March 01, 2014 @11:02PM (#7327650)
Crockford's explanation is pretty absurd, though.
Re:JSON5 is a proposed extension to JSON by nitrogen on Sunday March 02, 2014 @02:26AM (#7328122)
It makes perfect sense -- if you provide a freeform content section of an otherwise strictly formed document (for interoperability reasons), then people will abuse it to store arbitrary, uninteroperable data (as was seen with binary blobs being dumped into XML).

The point of a standardized serialization format is well-defined parsing semantics and universal interoperability.

Re:JSON5 is a proposed extension to JSON by coldtea on Sunday March 02, 2014 @08:01AM (#7328990)
>It makes perfect sense -- if you provide a freeform content section of an otherwise strictly formed document (for interoperability reasons), then people will abuse it to store arbitrary, uninteroperable data (as was seen with binary blobs being dumped into XML).

That will then be their own bloody problem, not Crockfords.

Re:JSON5 is a proposed extension to JSON by makomk on Sunday March 02, 2014 @07:36AM (#7328929)
Except that in practice, this has just meant that people have defined their own ad-hoc extensions to JSON that add support for comments, since it's so useful for stuff like JSON-formatted config files.
Re:JSON5 is a proposed extension to JSON by TazeTSchnitzel on Sunday March 02, 2014 @11:20AM (#7329589)
It's also meant that JSON documents don't have data encoded in comments. Working as intended.
Re:JSON5 is a proposed extension to JSON by einhverfr on Sunday March 02, 2014 @05:08AM (#7328560)
Indeed. I see SQL comments and Postgres COMMENT ON statements used to send information to applications. Really funny, that....
Re:JSON5 is a proposed extension to JSON by troels on Sunday March 02, 2014 @04:50AM (#7328498)
And you can't base64 encode it and store it in a string?
Re:JSON5 is a proposed extension to JSON by rat87 on Sunday March 02, 2014 @04:22AM (#7328422)
I thought xml was developed to be able to include binary parts on purpose since it can be useful.
Re:JSON5 is a proposed extension to JSON by balls187 on Sunday March 02, 2014 @01:11AM (#7327949)
How so?

Also "Suppose you are using JSON to keep configuration files, which you would like to annotate. Go ahead and insert all the comments you like. Then pipe it through JSMin before handing it to your JSON parser."

Seems like a perfectly fine way to have comments (if you absolutely need them) in a production environment.

Re:JSON5 is a proposed extension to JSON by DougBTX on Sunday March 02, 2014 @06:50AM (#7328791)
Presumably JSMin removes optional quotes in object laterals, so it probably doesn't output valid JSON.
Re:JSON5 is a proposed extension to JSON by spellboots on Sunday March 02, 2014 @07:16AM (#7328870)
That would be a pretty big mistake for the author of both the JSON spec and JSMin to make? Maybe it is but it seems unlikely.
Re:JSON5 is a proposed extension to JSON by reverius42 on Sunday March 02, 2014 @01:11PM (#7330031)
JSMin is not the right tool for this. I'm sure it conforms to the JavaScript (ECMAScript) spec but probably not the JSON spec. Here's a trivial JavaScript function to convert JSON5 to regular JSON with no comments and quoted identifiers and all that good stuff:

function JSON5_to_JSON(str) { return JSON5.parse(str).stringify(); }

This is exactly what is suggested in the Usage section of the linked article.

Re:JSON5 is a proposed extension to JSON by spellboots on Sunday March 02, 2014 @01:50PM (#7330207)
If the author of the JSON spec and JSMin says it's the right tool for the job, I am inclined to trust him on that barring further evidence that it is not...
Re:JSON5 is a proposed extension to JSON by reverius42 on Saturday March 08, 2014 @06:50PM (#7366883)
Since when does Crockford say that JSMin is the right tool for this particular job: translating JSON5 into regular JSON?
Re:JSON5 is a proposed extension to JSON by jrpt on Sunday March 02, 2014 @12:33AM (#7327855)
Yeah but lots of people disagree with his decision. Lack of comments makes it worse for config files.