Re: [Json] Limitations on number size?

John Cowan <cowan@mercury.ccil.org> Wed, 10 July 2013 14:20 UTC

Return-Path: <cowan@ccil.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 8D5D721E808A for <json@ietfa.amsl.com>; Wed, 10 Jul 2013 07:20:09 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.573
X-Spam-Level:
X-Spam-Status: No, score=-3.573 tagged_above=-999 required=5 tests=[AWL=0.026, BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1]
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 rzMe+xWF1f0j for <json@ietfa.amsl.com>; Wed, 10 Jul 2013 07:20:05 -0700 (PDT)
Received: from earth.ccil.org (earth.ccil.org [192.190.237.11]) by ietfa.amsl.com (Postfix) with ESMTP id 2F38721E8064 for <json@ietf.org>; Wed, 10 Jul 2013 07:20:02 -0700 (PDT)
Received: from cowan by earth.ccil.org with local (Exim 4.72) (envelope-from <cowan@ccil.org>) id 1UwuzC-0007En-BW; Wed, 10 Jul 2013 10:03:14 -0400
Date: Wed, 10 Jul 2013 10:03:14 -0400
From: John Cowan <cowan@mercury.ccil.org>
To: Stephan Beal <sgbeal@googlemail.com>
Message-ID: <20130710140314.GB16218@mercury.ccil.org>
References: <51DC7F87.6060503@gmail.com> <CAGrxA24v5L7oCGxEOwecJSLCNiLrSWSt=jFJMA0M9E8fztNLag@mail.gmail.com> <51DC95B2.8080801@gmail.com> <20130709231139.GC8043@gmail.com> <51DCA042.4000303@gmail.com> <CAKd4nAjHE8_4hWMG7jSzv=_VsoKb-cqNdX4CR+6R-p1WkQnDTQ@mail.gmail.com> <51DD3248.3020008@gmail.com> <CAKd4nAj66kGWvRGTUtwg_238LuiZ47jRLWAaCho2jH69Qu7ZUg@mail.gmail.com> <51DD53B4.6030207@gmail.com> <CAKd4nAgiVF2RAbf7Sts6nFchkLYO224BuLKbYuF-uC5GffnN7g@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <CAKd4nAgiVF2RAbf7Sts6nFchkLYO224BuLKbYuF-uC5GffnN7g@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Sender: John Cowan <cowan@ccil.org>
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: Wed, 10 Jul 2013 14:20:09 -0000

Stephan Beal scripsit:

> That's the beauty of it - in the context of the JSON RFC it's not an
> opinion - it's a technical fact. Unless the WG wants to extend JSON in
> incompatible ways (which they are prohibited from doing, from what i
> understand) there is zero chance of this revision of it supporting JSON.

JSON cannot support binary data *as a distinct type*.  It can of course
support binary data in a variety of other ways by convention:  as an
array of 0s and 1s or non-negative numbers < 256 or < 65536, or as an
array containing a string whose 16-bit whatever-they-ares represent the
binary object 16 bits at a time.

> As long as JSON does not specify a numeric precision (and IMO it "MUST NOT"
> ;) then any precision which can be represented per the grammar is legal.
> i.e. any precision for which we can represent digits 0 to 9 (which rules
> out the 0-bit precision someone suggested ;).

It doesn't, actually.  A JSON implementation can set any numerical limits
it likes, from 2^53 to 2^-53, or from 0 to 0 (exclusive).

-- 
My confusion is rapidly waxing          John Cowan
For XML Schema's too taxing:            cowan@ccil.org
    I'd use DTDs                        http://www.ccil.org/~cowan
    If they had local trees --
I think I best switch to RELAX NG.