Re: [Json] Meanwhile, out there...

John Cowan <cowan@mercury.ccil.org> Sun, 02 March 2014 16:41 UTC

Return-Path: <cowan@ccil.org>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 7E5581A096F for <json@ietfa.amsl.com>; Sun, 2 Mar 2014 08:41:23 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.147
X-Spam-Level:
X-Spam-Status: No, score=-3.147 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RP_MATCHES_RCVD=-0.547] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2xikZk2UwZsJ for <json@ietfa.amsl.com>; Sun, 2 Mar 2014 08:41:21 -0800 (PST)
Received: from earth.ccil.org (earth.ccil.org [192.190.237.11]) by ietfa.amsl.com (Postfix) with ESMTP id 99BB41A0972 for <json@ietf.org>; Sun, 2 Mar 2014 08:41:21 -0800 (PST)
Received: from cowan by earth.ccil.org with local (Exim 4.72) (envelope-from <cowan@ccil.org>) id 1WK9S0-0000B6-JW; Sun, 02 Mar 2014 11:41:16 -0500
Date: Sun, 2 Mar 2014 11:41:16 -0500
From: John Cowan <cowan@mercury.ccil.org>
To: Tim Bray <tbray@textuality.com>
Message-ID: <20140302164116.GD20855@mercury.ccil.org>
References: <7FE4234C-25BC-4AB9-B0DD-9E1641DB9BE0@mnot.net> <4CA4E293-3252-4082-A40C-DE867D732209@vpnc.org> <CAHBU6is9aq4Ev6zMBRbu+ik0VVbCLmedU9QkKHjxbw9pRjmm2A@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <CAHBU6is9aq4Ev6zMBRbu+ik0VVbCLmedU9QkKHjxbw9pRjmm2A@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Sender: John Cowan <cowan@ccil.org>
Archived-At: http://mailarchive.ietf.org/arch/msg/json/cWNy1V6MRJ7zjjNSVpHUnC0SzIk
Cc: Mark Nottingham <mnot@mnot.net>, Paul Hoffman <paul.hoffman@vpnc.org>, JSON WG <json@ietf.org>
Subject: Re: [Json] Meanwhile, out there...
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/json/>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 02 Mar 2014 16:41:23 -0000

Tim Bray scripsit:

> Actually, quite sensible on the surface, aside from allowing
> +/-Infinity.

I was thinking just the opposite; that's one of the few advantages
of JSON5.  The rest is nothing but surface syntactic variation, and the
only time that helps is when you're writing JSON by hand.  (Comments can
be handled using conventional object keys.)

Paul Hoffman scripsit:

> This appears to only be meant to work in a Javascript program,
> yes? Otherwise, what the heck does "Object keys can be unquoted if
> they're valid identifiers" mean?

It means just what it says: that you can omit the quotes around a JSON5
key if it happens to also be a valid JavaScript identifier.  The only
reason this isn't already so is that the inventor of JSON didn't want
to burden the definition of JSON with the list of 57 JavaScript reserved
words (as of ES3) that can't be identifiers.

In ES5 this isn't a problem any more, but there's a lot of legacy ES3.

-- 
By Elbereth and Luthien the Fair, you shall     cowan@ccil.org
have neither the Ring nor me!  --Frodo          http://www.ccil.org/~cowan