Re: [Json] Limitations on number size?

Nico Williams <nico@cryptonector.com> Thu, 11 July 2013 21:04 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 8E0AB11E8182 for <json@ietfa.amsl.com>; Thu, 11 Jul 2013 14:04:03 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.046
X-Spam-Level:
X-Spam-Status: No, score=-2.046 tagged_above=-999 required=5 tests=[AWL=-0.069, 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 ELbFxWA9jci7 for <json@ietfa.amsl.com>; Thu, 11 Jul 2013 14:03:58 -0700 (PDT)
Received: from homiemail-a74.g.dreamhost.com (caiajhbdcahe.dreamhost.com [208.97.132.74]) by ietfa.amsl.com (Postfix) with ESMTP id 4C15311E8179 for <json@ietf.org>; Thu, 11 Jul 2013 14:03:57 -0700 (PDT)
Received: from homiemail-a74.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a74.g.dreamhost.com (Postfix) with ESMTP id B4B9E67C06E for <json@ietf.org>; Thu, 11 Jul 2013 14:03:56 -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=7uxe8BJsEuJDMA3iDbJ7 mpuDAX4=; b=INpNGxMfSaee7R3A+A6tjif5RP7R+ll/mH3NZVG3EJZiZ7/5HYb6 FTeXeDGtYtoUDvCP/RmENpeb7QmgPb3E8XZIcrt+ANkjeuf4B7W3VpX5RQIqtCmJ pXY13xjpKcUdBvpaZfY6IrioU+G+Zw0iB71i8D9bvCidGNYZQdgH+nQ=
Received: from mail-we0-f175.google.com (mail-we0-f175.google.com [74.125.82.175]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a74.g.dreamhost.com (Postfix) with ESMTPSA id EDF3167C06B for <json@ietf.org>; Thu, 11 Jul 2013 14:03:54 -0700 (PDT)
Received: by mail-we0-f175.google.com with SMTP id t59so7241900wes.6 for <json@ietf.org>; Thu, 11 Jul 2013 14:03:52 -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=szjSITRp0TbjpYNhwnIn0aN9HvlTQNG6KJ2XVChh+kA=; b=HLbg2dF196X3BUKCi1sOISL8mdYimRPeDtXMDtITHwJ8j2NAQ9rhApFEm3CIXGFfze 35fWCFgrMo8mHiWDPITHm0Oc4ZlS3MigQFR1CHczPMQeQ/kbHr9xttVb0nAjoc8vckt3 fWqAAJeTiMyfXyXdMbd+n2BqDrMIULSHW7hU+MenPuqPVu+oIm4b4KWsbPU7wTUPgxgw 0j+vUnolfm+8VIbhlFu7j5u4mMfgZHZ7w1NCjrc4ZpU0+yCROjfRl0LVe0kP5hvMExc4 cejBMU70lCZawUxIA2SS5ANRXnKlc96ompqd5y+AzoAx6Vx3yPfLQcr0Qf7cuKo+QJPz GSSg==
MIME-Version: 1.0
X-Received: by 10.180.98.231 with SMTP id el7mr38348860wib.33.1373576632682; Thu, 11 Jul 2013 14:03:52 -0700 (PDT)
Received: by 10.217.38.138 with HTTP; Thu, 11 Jul 2013 14:03:52 -0700 (PDT)
In-Reply-To: <CALcybBBF+=7RE3wqhZE6m=VzQ1HZK3GChoZd2xr_3x992521pg@mail.gmail.com>
References: <51DC0F95.7010407@gmail.com> <hf8ot8hnpa93pi3t54c4d5qcc3p5tnb3ca@hive.bjoern.hoehrmann.de> <CAK3OfOgTNaLpRthrRcU4Bo+3z1aXUOOn0Ord7RBPN8z6TtiiWw@mail.gmail.com> <51DC7F87.6060503@gmail.com> <D3773B95-FF52-45D7-BE9F-2DEC92AFA67E@jorgechamorro.com> <51DC92B1.7000908@gmail.com> <CALcybBBF+=7RE3wqhZE6m=VzQ1HZK3GChoZd2xr_3x992521pg@mail.gmail.com>
Date: Thu, 11 Jul 2013 16:03:52 -0500
Message-ID: <CAK3OfOiQdHcGGMW2=aYiLvgYWmd_X6T+7mtqnV0m101XEz=pgQ@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: Francis Galiegue <fgaliegue@gmail.com>
Content-Type: text/plain; charset=UTF-8
Cc: Bjoern Hoehrmann <derhoermi@gmx.net>, Jorge Chamorro <jorge@jorgechamorro.com>, "Peter F. Patel-Schneider" <pfpschneider@gmail.com>, 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: Thu, 11 Jul 2013 21:04:03 -0000

On Thu, Jul 11, 2013 at 3:47 PM, Francis Galiegue <fgaliegue@gmail.com> wrote:
> On Wed, Jul 10, 2013 at 12:46 AM, Peter F. Patel-Schneider
> <pfpschneider@gmail.com> wrote:
> [...]
>>
>> But everything that I've read about JSON indicates that JSON is supposed to
>> be used for (portably) interchanging data.  If all there is to JSON is the
>> grammar then what's the point of JSON?
>>
>
> Some JSON parsers support {de,}serializing numbers of an arbitrary
> precision and/or scale. Castrating these languages just so that they
> limit their possible numeric representations is castrating the value
> of JSON itself.

That's not responsive to Peter's comment.  Just as we shouldn't leave
out bignums, we cannot require bignum support either, and people who
create open APIs with the intention to interop will have to face this
(and related) problems.

> The number production grammar is perfect as it is, I see no reason to change it.

The *grammar* is, the semantics are underspecified.

This, I think, is more fodder for: publish an update noting the
divergent interpretations, *perhaps*, in the same update, also
identify a most-likely-to-interop subset of JSON, and finally and
separately publish Internet JSON -- a subset of JSON with much less
room for interpretation and therefore much higher likelihood of
interoperability.