Re: [Json] "best practices" Vs. Profile for i-json

John Cowan <cowan@mercury.ccil.org> Mon, 04 August 2014 17:48 UTC

Return-Path: <cowan@ccil.org>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0D25B1A00A2 for <json@ietfa.amsl.com>; Mon, 4 Aug 2014 10:48:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.602
X-Spam-Level:
X-Spam-Status: No, score=-2.602 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3ln73i7FSyJL for <json@ietfa.amsl.com>; Mon, 4 Aug 2014 10:48:00 -0700 (PDT)
Received: from earth.ccil.org (earth.ccil.org [192.190.237.11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id AF4241A004D for <json@ietf.org>; Mon, 4 Aug 2014 10:47:52 -0700 (PDT)
Received: from cowan by earth.ccil.org with local (Exim 4.72) (envelope-from <cowan@ccil.org>) id 1XEMMP-00035Y-Bt; Mon, 04 Aug 2014 13:47:49 -0400
Date: Mon, 04 Aug 2014 13:47:49 -0400
From: John Cowan <cowan@mercury.ccil.org>
To: Nico Williams <nico@cryptonector.com>
Message-ID: <20140804174749.GE28851@mercury.ccil.org>
References: <2d53157574f749e0b1399b9e39564ecd@BL2PR02MB307.namprd02.prod.outlook.com> <CA+mHimPoZzmoio0Y+JgUDHd4b9B4yPm9fc3a1SCV6tayJ_9z7A@mail.gmail.com> <20140804165506.GL3579@localhost>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20140804165506.GL3579@localhost>
User-Agent: Mutt/1.5.20 (2009-06-14)
Sender: John Cowan <cowan@ccil.org>
Archived-At: http://mailarchive.ietf.org/arch/msg/json/3gikDxTCID4pdrpKfXrC-xSYHe8
Cc: Stephen Dolan <stephen.dolan@cl.cam.ac.uk>, Larry Masinter <masinter@adobe.com>, IETF JSON WG <json@ietf.org>
Subject: Re: [Json] "best practices" Vs. Profile for i-json
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.15
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: Mon, 04 Aug 2014 17:48:05 -0000

Nico Williams scripsit:

> Is a MUST really needed?  Suppose you have an encoder that produces
> numbers (not irrationals) that require better-than-IEEE754 to represent
> exactly.  A parser that can only handle IEEE754 should accept such
> numbers, but with loss of precision/range -- exactly what we already
> knew to expect from JSON as far as interoperability goes.

A fair point.  We can use the verbal formula employed by Unicode for
normalization, something like this:

   A sending implementation [MUST NOT/SHOULD NOT] expect a receiving
   implementation to distinguish between two numeric literals whose
   decimal values round to the same IEEE754 double-precision value
   (using standard round-to-nearest, ties-to-even rounding).

How's that?

-- 
John Cowan          http://www.ccil.org/~cowan        cowan@ccil.org
A few times, I did some exuberant stomping about, like a hippo auditioning
for Riverdance, though I stopped when I thought I heard something at
the far side of the room falling over in rhythm with my feet.  --Joseph Zitt