Re: [Json] Limitations on number size?

Francis Galiegue <fgaliegue@gmail.com> Thu, 11 July 2013 22:41 UTC

Return-Path: <fgaliegue@gmail.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 0D86021F9FF8 for <json@ietfa.amsl.com>; Thu, 11 Jul 2013 15:41:39 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.6
X-Spam-Level:
X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, NO_RELAYS=-0.001]
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 7-SwKH1osp3n for <json@ietfa.amsl.com>; Thu, 11 Jul 2013 15:41:38 -0700 (PDT)
Received: from mail-ea0-x232.google.com (mail-ea0-x232.google.com [IPv6:2a00:1450:4013:c01::232]) by ietfa.amsl.com (Postfix) with ESMTP id 5578021F9C6B for <json@ietf.org>; Thu, 11 Jul 2013 15:41:37 -0700 (PDT)
Received: by mail-ea0-f178.google.com with SMTP id l15so6080010eak.9 for <json@ietf.org>; Thu, 11 Jul 2013 15:41:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=+zylcS95dYt9evsIZTIr9iUr1UWx8x9NmQ+SA2wIgfg=; b=goNcqwyD7aypu0kqDITy0WQEsrpzwO2N9eYT3DlVZToAKvb3YrpRhkNcfQmvQMjdaw 5HvitemoDYSlPH1YDjuRw6/PjqoROmR+i/uRLidghquqEwhX9F8xnZhDsNH3RsY0PIoM rFNmRysYHnrCx/Q4/vavedPjsUfrEWXvIHSrcfVB2CZUD4t2hiKnsRNUPlCBArYxDMa4 2PIiABvPAISKnrUeyzvNPVasqjhecBsiCIv/0PvZ0oKizqx7uAk7EfT6tTsz6j82gYlk oF2uLJsfdxHaX+GXasp+v98kjxuWj6KHBdSaWqyW2z17zbQ6ZMXLrUTxIiRx3DOIRwJq jVKA==
MIME-Version: 1.0
X-Received: by 10.14.241.5 with SMTP id f5mr44152385eer.131.1373582496359; Thu, 11 Jul 2013 15:41:36 -0700 (PDT)
Received: by 10.14.175.135 with HTTP; Thu, 11 Jul 2013 15:41:36 -0700 (PDT)
In-Reply-To: <CAK3OfOh7YNbfCKe9Y1Q_5GA2NeK2+a-MajpxBg=pDE8oF3w+6Q@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> <CAK3OfOiQdHcGGMW2=aYiLvgYWmd_X6T+7mtqnV0m101XEz=pgQ@mail.gmail.com> <CALcybBCpeZZY+WTWuHb_=ArG_FZhJZ-fNLvSs42_JWy8+919-g@mail.gmail.com> <CAK3OfOh7YNbfCKe9Y1Q_5GA2NeK2+a-MajpxBg=pDE8oF3w+6Q@mail.gmail.com>
Date: Fri, 12 Jul 2013 00:41:36 +0200
Message-ID: <CALcybBCz_rw=NCjJ3ykYHkmwYzhH0mXbbMNBG=_DwOLM4dUgAw@mail.gmail.com>
From: Francis Galiegue <fgaliegue@gmail.com>
To: Nico Williams <nico@cryptonector.com>
Content-Type: text/plain; charset="UTF-8"
Cc: json@ietf.org, Bjoern Hoehrmann <derhoermi@gmx.net>, "Peter F. Patel-Schneider" <pfpschneider@gmail.com>, Jorge Chamorro <jorge@jorgechamorro.com>
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 22:41:39 -0000

On Thu, Jul 11, 2013 at 11:57 PM, Nico Williams <nico@cryptonector.com> wrote:
[...]
>>
>> I don't believe the JSON RFC should _require_ any semantics. Advice,
>> yes, why not. But API programmers are well aware that they have to
>> deal with their own language's/other people's languages limitations.
>> So, even then it does not look necessary at all.
>
> Well, OK, but whether we're dealing with APIs or protocols (or plain
> document formats), we need to concern ourselves with compatibility
> (APIs) and interoperability (protocols).

I agree, but then it is up to the protocols to define that. Say you
want to exchange prices over JSON, then it makes sense to require that
numbers be limited to two digits after the decimal point and, why not,
require that scientific notation not be used. (and 0.01 cannot be
represented reliably with a 64bit IEEE 754 floating point number, too)

But I believe this is not the role of JSON proper to define that.

> [...] If we specify no semantics then we're stuck with either the
> maximal interpretation of the grammar (binary strings! bignums! allow
> dup names! [since no specific handling of dup names can be considered
> a maximal interpretation...]) or an agreed subset, de facto or de
> jure.
>

I don't believe duplicate object names are quite the same level. This
was rather an oversight of RFC 4627 imho.

--
Francis Galiegue, fgaliegue@gmail.com
JSON Schema in Java: http://json-schema-validator.herokuapp.com