Re: [Json] Limitations on number size?

Nico Williams <nico@cryptonector.com> Wed, 10 July 2013 04:13 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 CC8CE11E810A for <json@ietfa.amsl.com>; Tue, 9 Jul 2013 21:13:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.082
X-Spam-Level:
X-Spam-Status: No, score=-2.082 tagged_above=-999 required=5 tests=[AWL=-0.105, 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 DmwNBEvzeA4A for <json@ietfa.amsl.com>; Tue, 9 Jul 2013 21:13:26 -0700 (PDT)
Received: from homiemail-a73.g.dreamhost.com (caiajhbdccah.dreamhost.com [208.97.132.207]) by ietfa.amsl.com (Postfix) with ESMTP id E952721F9B89 for <json@ietf.org>; Tue, 9 Jul 2013 21:13:25 -0700 (PDT)
Received: from homiemail-a73.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a73.g.dreamhost.com (Postfix) with ESMTP id 5202F1F0086 for <json@ietf.org>; Tue, 9 Jul 2013 21:13:25 -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=/tK78wUpt5PFJf/nO/vC kMaIcgM=; b=IfMvplxpRxuVzFDKRVbpnnSE6eZ9FnrM5/oU804a27hsEzlMazo9 7ZnmHvIPunOsi7E7NxP8tBZxAPm2JOjFCa1bEK6eC5JBqr4admzmb2VTuGxbtqkP /D+ma8SKJK7wJoXF/EkJDLmXAaZb6lFG6jAnIK6587wtFj1YUL9VTb8=
Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a73.g.dreamhost.com (Postfix) with ESMTPSA id E25BE1F0085 for <json@ietf.org>; Tue, 9 Jul 2013 21:13:24 -0700 (PDT)
Received: by mail-we0-f178.google.com with SMTP id u53so5448023wes.37 for <json@ietf.org>; Tue, 09 Jul 2013 21:13:23 -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=OXNZQuiGJ8IqWjWig0xw+3rE3meRpJEADb2D9n5sT4U=; b=fDNOvLeFP7tmlqOaxQj3PcSef6hX+hKoZGFd/7muX/5j3Wi0Zr8FatPkjWvlVcpOsV 4Sa8rhzuGUHtRbdHZqMTGArugLLguzoGh/5CLcm0bfY5lep6sMcyJr+dnDph6Lxhe8Ty RYlsCxwYCZn34tTz6Q7G7Guxw9Ktz3Lbb4+t24vn1tqpdfQQ8l+lGRS5gGG8UIfhqnDi vUHpj3q6qbsCc79b1C7TgD5tVq7qrVfrhtpawnHWa2KBXWnqf0bmhfFyCukJoXle1LTR xxSPiQbj/d9upmK9Jzjnw+SJ+TpfXbstZHvBdLujXWA5vRsPmYjpTzmzmAGDfHbrdpfC Ibug==
MIME-Version: 1.0
X-Received: by 10.180.74.162 with SMTP id u2mr4552517wiv.36.1373429603164; Tue, 09 Jul 2013 21:13:23 -0700 (PDT)
Received: by 10.217.38.138 with HTTP; Tue, 9 Jul 2013 21:13:23 -0700 (PDT)
In-Reply-To: <20130710024215.GO9153@mercury.ccil.org>
References: <51DC0F95.7010407@gmail.com> <hf8ot8hnpa93pi3t54c4d5qcc3p5tnb3ca@hive.bjoern.hoehrmann.de> <CAK3OfOgTNaLpRthrRcU4Bo+3z1aXUOOn0Ord7RBPN8z6TtiiWw@mail.gmail.com> <51DC7F87.6060503@gmail.com> <CAGrxA24v5L7oCGxEOwecJSLCNiLrSWSt=jFJMA0M9E8fztNLag@mail.gmail.com> <20130710024215.GO9153@mercury.ccil.org>
Date: Tue, 09 Jul 2013 23:13:23 -0500
Message-ID: <CAK3OfOhdck=d6KT+QGPXFE+GOCteKWG4AFoLLzpm5oH=9yO=pQ@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: John Cowan <cowan@mercury.ccil.org>
Content-Type: text/plain; charset="UTF-8"
Cc: "Peter F. Patel-Schneider" <pfpschneider@gmail.com>, Bjoern Hoehrmann <derhoermi@gmx.net>, Tatu Saloranta <tsaloranta@gmail.com>, "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 04:13:31 -0000

On Tue, Jul 9, 2013 at 9:42 PM, John Cowan <cowan@mercury.ccil.org> wrote:
> Apparently, there are already practical problems with interchanging
> 64-bit longs: google for [json large numbers bugs] for lots of reports.
> While there are apparently int32-only systems out there, it's clearly
> understood that they are unusually restricted: such is not the case
> for JavaScript-hosted implementations.

So let's survey implementations.

ECMAScript, Perl, Python, libjv, Jansson, json-c -- all have doubles.

Heimdal's not-really-intended-for-external-use-(not-yet) JSON
implementation only does 32-bit integers.  This one doesn't count, and
it'd be easy to add double support to it if it mattered.  Are there
any C JSON libraries that do NaN coding?

Those are the ones I know, use, and/or contribute to.

Nico
--