Re: [Json] Limitations on number size?

Nico Williams <nico@cryptonector.com> Tue, 04 June 2013 01:25 UTC

Return-Path: <nico@cryptonector.com>
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 82F5321F98AC for <json@ietfa.amsl.com>; Mon, 3 Jun 2013 18:25:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.76
X-Spam-Level:
X-Spam-Status: No, score=-1.76 tagged_above=-999 required=5 tests=[AWL=0.217, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622]
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 QZx8lCWUmK2A for <json@ietfa.amsl.com>; Mon, 3 Jun 2013 18:25:25 -0700 (PDT)
Received: from homiemail-a34.g.dreamhost.com (caiajhbdcahe.dreamhost.com [208.97.132.74]) by ietfa.amsl.com (Postfix) with ESMTP id 6FD4921E80A1 for <json@ietf.org>; Mon, 3 Jun 2013 17:43:12 -0700 (PDT)
Received: from homiemail-a34.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a34.g.dreamhost.com (Postfix) with ESMTP id 6A9A21005D for <json@ietf.org>; Mon, 3 Jun 2013 17:43:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h= mime-version:in-reply-to:references:date:message-id:subject:from :to:cc:content-type; s=cryptonector.com; bh=FQXhlhTxX1mWiIVDnuPV qX8NSVs=; b=QJkC2qPTwQcq5NJeHKfe2++nJIxjDdGgJL1Nnk/BIfyGDGCfUgE6 BW7o10zxmqyngWieNzOkWy66BEs2sDpZB9hjSU0CR60PiK1XbUNLj8K6U1wn4Ob/ NIpayZEyF7T3+/6ccUwSMvxSQ4LsvDOfrcghqqTWKXFItWQW4eHbhJI=
Received: from mail-we0-f176.google.com (mail-we0-f176.google.com [74.125.82.176]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a34.g.dreamhost.com (Postfix) with ESMTPSA id 4DB2410062 for <json@ietf.org>; Mon, 3 Jun 2013 17:42:55 -0700 (PDT)
Received: by mail-we0-f176.google.com with SMTP id t61so2284850wes.7 for <json@ietf.org>; Mon, 03 Jun 2013 17:42:53 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=XXqanq0keBvWc0crw0YDdBX/WjLVfpPekr+c6CPUyU4=; b=HX7Payb9LPD/5fRoaZvoa4Lb4hF6DNMibkoLfOLPV+QX+gEa2bST+89eq0Er4JUl8U mbrDNq5FyM0cpbdwum3O++D3tJVFmSO2C/HeNaGQd08r7XESsrT5ZEH/imBizDbobiWe GfaTmEHwpFLBxWFsvBQlT11BdFwmNu6mx2AyNuNprkHMM05FJP7/aX20JBg8mtkXFagp lCbzmD66XGYrUUzjR56reWJBwxUKnieievWdwvvPj9RjaYt/P2z+wvWbxuRFNRca1y4Z qFR/j2mXxL2QweFITa93YRuoy1d40eDfd9EWsF3oNlDFFZoNLiv4XYDJJcWOQ28HHyd3 OWMg==
MIME-Version: 1.0
X-Received: by 10.180.185.244 with SMTP id ff20mr520116wic.0.1370306573466; Mon, 03 Jun 2013 17:42:53 -0700 (PDT)
Received: by 10.216.63.136 with HTTP; Mon, 3 Jun 2013 17:42:53 -0700 (PDT)
In-Reply-To: <C42654A3-E218-45A8-B368-4A60CB89619D@vpnc.org>
References: <CAK3OfOgPGi4PKxKAGEG=PCv-xaszMqWpUUUH2B9f0UaeMMO1gQ@mail.gmail.com> <C42654A3-E218-45A8-B368-4A60CB89619D@vpnc.org>
Date: Mon, 03 Jun 2013 19:42:53 -0500
Message-ID: <CAK3OfOifut8UziUfjWKLbbpAZjd7yy1TEgnTaLtwfd3GUSrooA@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: Paul Hoffman <paul.hoffman@vpnc.org>
Content-Type: text/plain; charset="UTF-8"
Cc: "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] Limitations on number size?
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: Tue, 04 Jun 2013 01:25:41 -0000

On Mon, Jun 3, 2013 at 5:10 PM, Paul Hoffman <paul.hoffman@vpnc.org> wrote:
> Greetings. I'm forwarding this fragment with permission from the AppsAWG mailing list. It might warrant clarification in -bis document.
>
> Begin forwarded message:
>
>> From: Nico Williams <nico@cryptonector.com>
>> On Mon, Jun 3, 2013 at 10:21 AM, Manger, James H
>> <James.H.Manger@team.telstra.com> wrote:
>>>> Imagine JSON had bignums (doesn't, but imagine).
>>>
>>> JavaScript might not, but JSON actually does have indefinite length bignums. A JSON number can have any number of decimal digits.
>>
>> Yeah, but it is constrained to IEEE 754 64-bit floating point values, no?
>
> I don't see any limitation in RFC 4627, but it would be interesting if other folks here believe there is a limitation as Nico does.

Nor does the draft ECMAScript 6 say that.  But a) ECMAScript 6 does
restrict ECMAScript numeric values to IEEE 754 64-bit values
(including NaN, positive infinity, and negative infinity).

I have been told by the maintainer of at least one JSON parser/encoder
that they will not add support for anything other than IEEE 754 64-bit
values.  I'm not sure if I should name the project, but I'll say this:
it's damn near the best C JSON library I've yet seen.  The point is
that the perception that JSON is a subset of JavaScript (ECMAScript)
is out there, and that because the latter is constrained as described,
so should the former.

I think that JSON should be taken as so constrained by ECMAScript, but
more importantly, any constraint, or even no constraint, should be
stated explicitly.

Nico
--