Re: [Json] Proposal: the minimal edit

Carsten Bormann <cabo@tzi.org> Sat, 22 June 2013 22:03 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4649921F9BF6 for <json@ietfa.amsl.com>; Sat, 22 Jun 2013 15:03:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -106.249
X-Spam-Level:
X-Spam-Status: No, score=-106.249 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, HELO_EQ_DE=0.35, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1Uexf8EKVNfJ for <json@ietfa.amsl.com>; Sat, 22 Jun 2013 15:03:51 -0700 (PDT)
Received: from informatik.uni-bremen.de (mailhost.informatik.uni-bremen.de [IPv6:2001:638:708:30c9::12]) by ietfa.amsl.com (Postfix) with ESMTP id B0EB921F9DE7 for <json@ietf.org>; Sat, 22 Jun 2013 15:03:50 -0700 (PDT)
X-Virus-Scanned: amavisd-new at informatik.uni-bremen.de
Received: from smtp-fb3.informatik.uni-bremen.de (smtp-fb3.informatik.uni-bremen.de [134.102.224.120]) by informatik.uni-bremen.de (8.14.4/8.14.4) with ESMTP id r5MM3ls6027751; Sun, 23 Jun 2013 00:03:47 +0200 (CEST)
Received: from alma.fritz.box (p5B3FF3E1.dip0.t-ipconnect.de [91.63.243.225]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp-fb3.informatik.uni-bremen.de (Postfix) with ESMTPSA id 29CA8783D; Sun, 23 Jun 2013 00:03:47 +0200 (CEST)
Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\))
Content-Type: text/plain; charset="iso-8859-1"
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <20130622212219.GW31186@mercury.ccil.org>
Date: Sun, 23 Jun 2013 00:03:46 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <8DB99A42-7666-443A-9C99-53F8A1AACF17@tzi.org>
References: <CAChr6SyN4Z3Hh8OFGHkK+AJN0+S09wMfjeobZ51GjKNL+GhPsw@mail.gmail.com> <CAHBU6ivhoUM9cfUnc1YfnyDdQnWQ=Mj10cSoYn0qouMQ0F94XA@mail.gmail.com> <CAChr6SyQDjik_BTojXdw3G7_B=W5iZXksuM15VYwGJqr8WHdhw@mail.gmail.com> <CAChr6SwbFfR5UQuU2ceJhDeGAhv5Zy0dKA3szzO_KGfjA7fx5Q@mail.gmail.com> <20130622205936.GV31186@mercury.ccil.org> <CAChr6SwJ5TkYw4TFxWv=9hZPU_jtKuSLDSrN9u+SzBBwo1aspA@mail.gmail.com> <20130622212219.GW31186@mercury.ccil.org>
To: John Cowan <cowan@mercury.ccil.org>
X-Mailer: Apple Mail (2.1508)
Cc: "json@ietf.org" <json@ietf.org>, Tim Bray <tbray@textuality.com>, R S <sayrer@gmail.com>
Subject: Re: [Json] Proposal: the minimal edit
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.12
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: Sat, 22 Jun 2013 22:03:59 -0000

On Jun 22, 2013, at 23:22, John Cowan <cowan@mercury.ccil.org> wrote:

>> This bit is not quite right. I think they'll accept anything that conforms
>> to the JSON grammar, and then produce a number that is not what the sender
>> intended if it's out of range.
> 
> Fair enough.  "Only interpret correctly", perhaps, then.

Trying to understand this discussion:

Is the IEEE 754 number a JavaScript parser generates from [1.1] "interpreted correctly"?
There is no way to "correctly" represent 1.1 in IEEE 754 double precision binary.

So maybe it is more useful to point out that parsers (and that observation is not limited to JavaScript) might convert JSON's decimal numbers to a (binary or other) form, losing precision and range in the process.

Section 4 now says:

   An implementation may set limits on the size of texts that it
   accepts.  An implementation may set limits on the maximum depth of
   nesting.  --> An implementation may set limits on the range of numbers. <--
   An implementation may set limits on the length and character contents
   of strings.

So maybe it is useful to point out that parsers (again, not just the ones that try to conform to a version of ECMAscript) are also likely to set limits on the precision of numbers (maybe that even was meant to be included by the term "range" here, although I'd prefer the stricter interpretation of that term).

Grüße, Carsten