Re: [Json] Update Standard to support ECMA-262 BigInt

Tim Bray <tbray@textuality.com> Thu, 29 April 2021 23:38 UTC

Return-Path: <tbray@textuality.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 051683A1825 for <json@ietfa.amsl.com>; Thu, 29 Apr 2021 16:38:10 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=textuality-com.20150623.gappssmtp.com
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 Z-NkMDfXwzBS for <json@ietfa.amsl.com>; Thu, 29 Apr 2021 16:38:05 -0700 (PDT)
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E0ACD3A131B for <json@ietf.org>; Thu, 29 Apr 2021 16:38:04 -0700 (PDT)
Received: by mail-lf1-x135.google.com with SMTP id z13so26414208lft.1 for <json@ietf.org>; Thu, 29 Apr 2021 16:38:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=textuality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MoTgbDhXNMtInwQHA7aeAqobAQyYmB45rRcSp53dbNY=; b=dZDSS2lrsJGPWgdmnS/nToHUBOT5twdL8F8XYRKij8kgnI+DA4rRpArGu/QjZIezVa rZCYbbiUkCAF6Bk9MwnpiVHPj4EJFiJ+sDViaEIRWCHU+uBaKHnjd7umci569PkdLhBp Y19wLiwWjI8KJiIyPVSK7Co6pIw5+nnmQSBXgJFNIqecDpl2PGnuDBAS0OVJfuf9vAQw kQ+P9BADNdyOdMFesLBvi+WTUko/2pFvR8No8MqXeXFhsNgFBVioB+sqXWu1vpB5cEF7 OMCy9I8VPz4FvHyjRLcvDmFMMpMDxI1nLLd9f60ZKupHZjJ68DmUZDsdXxlA19hKfoqW 1N/A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MoTgbDhXNMtInwQHA7aeAqobAQyYmB45rRcSp53dbNY=; b=tK1eKdB5qSE4DedvAYeqJdl+WEUSfCvOqZIGlZsEgexeVl4F13IVRj9pM+Sx6zfCyd /bfbLDmYp6v+fsohJlMwDLklQD7Z8gfr6+MPKqvx8KEbNh/MlVVs4oOcrQxlsp/nz02N 6Cv++0YbeQUDF5frYGSvyGewnCbwIf8YkG33yEcFzIDkLR6oxA7sbcSGoTMlHXJsTes/ pvrQx//WySo9Mr6/er86I8SQu2aOOlR4WA6gWDoW9UhtKotiDDYe/CD1hJnMWM3FdGHL kMEeXrqRn6Iy51t/8rxHcpoZzFgbtkELKTzHjD62PGM39QSHnDmxt/PTmbhQsUw3bpRC c+Hg==
X-Gm-Message-State: AOAM533SRTXZMDhYsTQT2btvDThICSBoq/s30vHDE7prOejC2Q6cNW0F l3T9j+L15GulmEvu4nBHjpmHOzDdS4J+m629bW03wQJY5jgiZw==
X-Google-Smtp-Source: ABdhPJyUJ9ZTNdP5xxHPNMX/F89+x2jjs7UjKNdlMUM7qKrXu3Z2ZEdfn3LrbaF0u0QWlM/KlTCzwTHCpzKUUPiYpPI=
X-Received: by 2002:a19:5011:: with SMTP id e17mr1423078lfb.536.1619739482367; Thu, 29 Apr 2021 16:38:02 -0700 (PDT)
MIME-Version: 1.0
References: <014e01d73aa1$81aa0d30$84fe2790$@thisisbeacon.com> <5987db79-06a7-69ab-faff-29c763a9a98d@codalogic.com> <CAE5tNmrrk8KjHh7-31Og0x-R+2S_4TQ-K4P+eJutO0p6K57FHg@mail.gmail.com>
In-Reply-To: <CAE5tNmrrk8KjHh7-31Og0x-R+2S_4TQ-K4P+eJutO0p6K57FHg@mail.gmail.com>
From: Tim Bray <tbray@textuality.com>
Date: Thu, 29 Apr 2021 16:37:51 -0700
Message-ID: <CAHBU6ivd4nLuoZR-1NugkR2FEriSxH3D7Gg4zK+E6xceFu+xFg@mail.gmail.com>
To: David Kemp <dk190a@gmail.com>
Cc: JSON WG <json@ietf.org>
Content-Type: multipart/alternative; boundary="00000000000079c81c05c124fc48"
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/C1BafaX57DjKFu8o_EdsJdSkOs4>
Subject: Re: [Json] Update Standard to support ECMA-262 BigInt
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.29
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: <https://mailarchive.ietf.org/arch/browse/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, 29 Apr 2021 23:38:10 -0000

Yeah, speaking as the editor of a bunch of those RFCs, I would very much
like it if JSON could be extended to have comments, timestamp literals, and
typed numbers.  But it's too late. JSON is finished, is generated and
consumed by a very large amount of deployed software which is simply not
going to be updated; changing the syntax at this point would be
catastrophic.   For crypto apps, you pretty well have to put the big
numbers in strings.

Sorry we can't help.

On Thu, Apr 29, 2021 at 2:33 PM David Kemp <dk190a@gmail.com> wrote:

> Also as an observer, RFC8259 doesn't care what you put in numbers either,
> as long as they are digits with no leading zeroes and an optional
> fractional part.
>
> "This specification allows implementations to set limits on the range and
> precision of numbers accepted."
>
> If an implementation supports bignums (or even int64s) then nothing in the
> JSON
> spec prohibits it from doing so.  If the implementation supports only IEEE
> 754 doubles,
> then it's the implementation that needs to be updated, not the standard.
> If you're
> relying on implementations outside of your control, then putting numbers
> in strings
> is a workaround to prevent them from getting molested along the way.
>
> That said, applications that handle massive datasets, or at least massive
> amounts
> of serialization, are probably better off using a serialization designed
> for that purpose
> such as Protobuf or CBOR.
>
> Dave
>
>
> On Thu, Apr 29, 2021 at 7:22 AM Pete Cordell <petejson@codalogic.com>
> wrote:
>
>> As no one else has answered this, my understanding, more as an observer
>> than as a key working group member, is that you would have to put such
>> large numbers in a string and RFC 8259 doesn't care what you put in
>> strings.  Things like dates, durations, IP addresses, geolocations and
>> large numbers in strings are beyond its scope.
>>
> _______________________________________________
> json mailing list
> json@ietf.org
> https://www.ietf.org/mailman/listinfo/json
>