Re: [Json] I-JSON Topic #5: Numbers

Stefan Drees <stefan@drees.name> Wed, 30 April 2014 06:04 UTC

Return-Path: <stefan@drees.name>
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 909FB1A09C5 for <json@ietfa.amsl.com>; Tue, 29 Apr 2014 23:04:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.55
X-Spam-Level:
X-Spam-Status: No, score=-1.55 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HELO_EQ_DE=0.35, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=no
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 VPv8BfQ78qZ9 for <json@ietfa.amsl.com>; Tue, 29 Apr 2014 23:04:06 -0700 (PDT)
Received: from mout.web.de (mout.web.de [212.227.15.3]) by ietfa.amsl.com (Postfix) with ESMTP id 7E79A1A09DF for <json@ietf.org>; Tue, 29 Apr 2014 23:04:04 -0700 (PDT)
Received: from newyork.local.box ([80.187.97.156]) by smtp.web.de (mrweb102) with ESMTPSA (Nemesis) id 0Le4Po-1XDN4H2Ltc-00prQU for <json@ietf.org>; Wed, 30 Apr 2014 08:04:01 +0200
Message-ID: <53609250.1040705@drees.name>
Date: Wed, 30 Apr 2014 08:04:00 +0200
From: Stefan Drees <stefan@drees.name>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.4.0
MIME-Version: 1.0
To: json@ietf.org
References: <535EB3BF.8080606@cisco.com> <295B22FF-2677-4FC8-B9B8-B59D9F4B78D2@vpnc.org>
In-Reply-To: <295B22FF-2677-4FC8-B9B8-B59D9F4B78D2@vpnc.org>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:KXfu1UyVAMTT7/XAn3WpOdtfUvNtjRb1Sc4nG5iDp4u++9f96xb 0XFjgMITSASmASFRa4x+wW6XFoQ6WMRC9S0e4pP+4uACQV3fMbVvB0NqnuDsW+87OM2zpP9 t9mZrnx4SG81cUTbBjRtrxg6XvgobhveJIo/xvr6ivcgBN34YdIqGHxARfox+UE8waDD6n0 ZZVwqasMP6fXc86qTdnXg==
Archived-At: http://mailarchive.ietf.org/arch/msg/json/la7wTMssVKDccb4IhLJnh3i_WAI
Subject: Re: [Json] I-JSON Topic #5: Numbers
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: stefan@drees.name
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, 30 Apr 2014 06:04:08 -0000

Am 29.04.14 19:33, schrieb Paul Hoffman:
> <no hat>
>
>> "draft-i-json-01 says that you MUST not put in a string representing a
>> number with greater precision/magnitude than IEEE754 doubles can
>> support.   I think this is a good idea but I'm a little nervous
>> because I've never written the code; if this is unreasonably hard at
>> either the sending or receiving end someone should say so."
>
> From the comments so far, it seems like it is not clear how to make
> such restrictions in some languages. If we can't be definitive about
> what we mean, we should remove it. RFC 7159 has pretty strong wording
> already.

from another context I remember, that being definitive here is 
complicated (at least when a generic consumer of the message is assumed)

1.
There are clients that simply cannot digest a number being larger than 
IEEE754 doubles. In a robust scenario, I would expect, that in that 
case, they reparse that token as a decorated (client side) string and 
try to apply local rules in handling what has been received in that "slot".

2.
Clients that can digest numbers of arbitrary length on the other hand 
would be "slowed down" when all numbers not fitting in IEEE754 doubles 
would be string-wrapped.

3.
JSON strengths are not with types or schemas, but it also helps the 
client, when every value of identically named keys or constituents of 
arrays are of the same "kind" at least in moretrusted setups.

So for me it would be ok to remove it, as no matter how we resolve it, 
from the above mentioned 3 "viewpoints" there are always some "local 
rules" or extra effort involved to handle the general case, which we 
must describe or leave out.

{"stefan": "All the best."}