Re: [Json] Limitations on number size?

Nico Williams <nico@cryptonector.com> Tue, 09 July 2013 23:01 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 B213B11E8197 for <json@ietfa.amsl.com>; Tue, 9 Jul 2013 16:01:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.086
X-Spam-Level:
X-Spam-Status: No, score=-2.086 tagged_above=-999 required=5 tests=[AWL=-0.109, 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 hE6SSbb+mXnd for <json@ietfa.amsl.com>; Tue, 9 Jul 2013 16:00:55 -0700 (PDT)
Received: from homiemail-a90.g.dreamhost.com (caiajhbdcbhh.dreamhost.com [208.97.132.177]) by ietfa.amsl.com (Postfix) with ESMTP id B241311E8195 for <json@ietf.org>; Tue, 9 Jul 2013 16:00:55 -0700 (PDT)
Received: from homiemail-a90.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a90.g.dreamhost.com (Postfix) with ESMTP id 45A192AC073 for <json@ietf.org>; Tue, 9 Jul 2013 16:00:55 -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=t2MhviirgZZt3OtFkyS3 XAJmo4A=; b=xH0/VAAnCfukeV1HJJwS/y0r2VUwq0fbcm7XxzBS4Rh+sK8Guwhe UqcQ+Kyq1lEQoYod7GcyT/UekdWk8Htw23gD8C4gtn43SWUImZZN4wh1fOULZdDy vgJ076hcChcyxPAe+ZxiUfIVXBbVagjAE3BOivfKvW5CfobB+BiX9Eo=
Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a90.g.dreamhost.com (Postfix) with ESMTPSA id EA9722AC072 for <json@ietf.org>; Tue, 9 Jul 2013 16:00:54 -0700 (PDT)
Received: by mail-wg0-f45.google.com with SMTP id j13so5285863wgh.0 for <json@ietf.org>; Tue, 09 Jul 2013 16:00: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=BNj7QQ7w8nVF2V8tI0NJRKafiHguoV5tWNRSriAWXas=; b=Gk+eFk0tc5dY5bY2QH4Bs1npXunJTuUgZkWR5zFnODAyrGkb/ROp1645eoMp9eF1YZ OpAjxTiIxYOUdlBtukpE/zQECJedDnT8zkkQxQI8BBI9zzPHXy69kPx+UikyESxZ4iKK hSo914LjywU5+writu5WJ6voj1Po6cT9spMixdboJq4Q+s0gCuauuw0/Kh4F9cDkFU9n uVwX0S6HSD86PF1WZvpvRESu9HZGzqaDLJnw3NshFB2e+J263QRnI/vWqCmFIY+oDL5M 22ox1tW/jcpypERtxSgraOaR5B8EJQxgUmPdzsW38axgWWWa4BgANpwa9rkOczxvB44m +YLg==
MIME-Version: 1.0
X-Received: by 10.180.185.176 with SMTP id fd16mr8314605wic.20.1373410853388; Tue, 09 Jul 2013 16:00:53 -0700 (PDT)
Received: by 10.217.38.138 with HTTP; Tue, 9 Jul 2013 16:00:53 -0700 (PDT)
In-Reply-To: <51DC92B1.7000908@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>
Date: Tue, 09 Jul 2013 18:00:53 -0500
Message-ID: <CAK3OfOiNo6q0T6gOKZmCrhfXvOUuBZSKMP3319TSUFBPqdVAwQ@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: "Peter F. Patel-Schneider" <pfpschneider@gmail.com>
Content-Type: text/plain; charset="UTF-8"
Cc: Jorge Chamorro <jorge@jorgechamorro.com>, Bjoern Hoehrmann <derhoermi@gmx.net>, 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, 09 Jul 2013 23:01:00 -0000

On Tue, Jul 9, 2013 at 5:46 PM, 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?

+1.  In practice agreeing on a subset of typing results in interop, at
least for implementations of specific applications.

Sometimes, when straying past that subset, there's loss of
information, and that mostly works out.  Sometimes parsers reject
inputs, this results in implementors figuring out what happened and
how to improve interop, or else the user doesn't bother reporting the
problem.

We can definitely identify a subset of JSON that is extremely likely
to interop successfully:

 - strings being Unicode character strings, possibly with paired
surrogates (there are still some implementations, no doubt, that can't
handle code points outside the BMP)

 - top-level is an array or object (though many parsers have options
to allow other top-level types, so I don't think this is too
important)

 - no dup names (parsers might or might not reject, or deconflict)

 - numbers as 32-bit signed integers, or maybe even numbers as IEEE
754 64-bit doubles -- TBD from a survey we might never do

Note that the proposed I-JSON need not be that subset of JSON most
likely to interop, just the subset we want for Internet protocols.
And we might be happy enough with I-JSON that we never define any
other subsets of JSON.

RFC4627's underspecification, coupled with host languages with widely
varying attributes led to JSON being a superset than most
implementations of it.

ECMAScript JSON is also a subset of RFC4627, and is neither a subset
nor superset of the proposed I-JSON.

> What is (surprisingly) missing in JSON is a firm notion of the data being
> represented by the syntax.   A pale shadow of this issue for strings appears
> to have been consuming this working for quite some time.

Yes.

Nico
--