I didn't get that mail at all; I assume it was a mistaken private response?
On Tue, Jul 11, 2017 at 10:23 PM, Don Griffin <[email protected]> wrote: > I don't think your "DO NOT USE JSON ... FOR HUMAN INPUT" notion was > noticed by ... anyone really :) > > Node.js has package.json, other package managers use component.json, > editors use settings.json and some even throw that file in to a text editor > as the configuration UI. AFAICT this whole notion of making JSON more like > JavaScript object notation is because human's do interact with JSON quite > often and want some of the little creature comforts. > > JSON5 may be overkill, but it seem unquoted keys and comments (and real > dates) would be welcome by us unfortunate humans. :) > > > > > Best, > Don > -- > Don Griffin > Sr Director of Engineering > Sencha, Inc. > https://www.sencha.com/ > > On Mon, Jul 10, 2017 at 11:33 PM, Carsten Bormann <[email protected]> wrote: > >> On Jul 11, 2017, at 06:14, J Decker <[email protected]> wrote: >> > >> > Why does JSON have quoted field names anyway (which I could understand >> if they included spaced). >> >> Douglas Crockford has explained this bit of history in talks about JSON: >> >> Originally, they weren’t quoting map keys (names of object members) if >> they looked like identifiers in JavaScript. (In early JavaScript-based >> implementations, JSON data was directly fed as code into the JavaScript >> interpreter so there was no need to write a decoder.) >> >> But then some application was using “do” as a map key. “do” happens to >> be a reserved word in JavaScript, breaking the decoding process. So they >> had to check if the map keys were reserved words and quote them in that >> case. That set then would have to become part of the JSON > > I see. keywords in that direction. > specification. Worse, the set of reserved word in JavaScript could >> (theoretically) change, so either the JSON specification would need to >> change, too, or the next version of JavaScript would no longer support >> direct use of JSON as JavaScript code. >> >> So they decided to simply always quote, and that was that. >> >> The approach to execute JSON as JavaScript code of course is history now, >> but JSON hasn’t changed back. >> >> Actually, with RFC 7159 and ECMA 404 out and JSON very widely >> implemented, any proposal to change the JSON syntax is a complete >> non-starter. >> > I'm not proposing any change; I was proposing another facility JSON5 in parallel to the existing JSON. Although JSON5 being a superset of JSON and there not being any immediate issue with using JSON with JSON5, except it would be impossible to knowing whether a platform actually has JSON5 support in 'JSON' namespace. It would be much more clear if it was in a separate namespace entirely. but all of that is about parse(); on the side of stringify, if the JSON original was changed, it would start generating invalid output that existing JSON readers would not work with, sounds like a bad plan also. Well it appears JSON5 is trying to stay at ES5 level (some sort of matching identifier there) and as such won't support `(back-tick) quoted strings. So I don't care so much. and I don't think tail commas in arrays don't behave correctly. > >> (Most of these proposals come from people who notice that JSON is bad for >> conversing about data or for human input. Well, that is not what JSON is >> meant for. DO NOT USE JSON FOR CONVERSING ABOUT DATA OR FOR HUMAN INPUT. >> JSON is an interchange format. There are much better formats for humans >> inputting and conversing about JSON-modeled data, such as YAML, which is >> even a superset of JSON. No point in messing around with JSON if the >> problem has already been solved.) >> >> Of course, if saving bytes is your objective, you might want to look at >> CBOR. I wonder when that is picked up by the JavaScript spec (there are >> libraries, of course). >> >> Grüße, Carsten >> >> _______________________________________________ >> es-discuss mailing list >> [email protected] >> https://mail.mozilla.org/listinfo/es-discuss >> > > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

