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

David Kemp <dk190a@gmail.com> Thu, 29 April 2021 21:33 UTC

Return-Path: <dk190a@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 51BED3A10F5 for <json@ietfa.amsl.com>; Thu, 29 Apr 2021 14:33:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.096
X-Spam-Level:
X-Spam-Status: No, score=-2.096 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, 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=gmail.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 HAKEI6s9UMFB for <json@ietfa.amsl.com>; Thu, 29 Apr 2021 14:33:12 -0700 (PDT)
Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) (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 BF6313A10EC for <json@ietf.org>; Thu, 29 Apr 2021 14:33:12 -0700 (PDT)
Received: by mail-oi1-x22a.google.com with SMTP id u80so34358300oia.0 for <json@ietf.org>; Thu, 29 Apr 2021 14:33:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=GjWwvtRB60p+scoH5PrBD2lmPKViMbc0XfXzDKIS+Qo=; b=D1pqSeXUzmJW6ARFW+0pnO3zvLG32Ew/SpwLOwb1lTK23cadSah4s0CZ3dzzH63uuZ mCcF3qICr2WPCownMKdAUD5wB3gxkyjKG5NdLiJaXKQJi77KG+ohh9pmq4UoilgKiEZw EOmlGzJxj7jpzBd33JLZCcmog+tibuKfBH8wz3OnSopIqZQhneLn1+j5AHquAjw7xPoP IqUNHpGmktRMnd2RrBLopj4Fl92xY12yI7EG6DwazJfb6GzZFM0gQ1KWPv5GKyU87oNN tADLUsktqXk4eh9+MckR6zqmh5epfizh8uU0nyEscLGEX3DeRx53Ubu6CM3YIsZWDPl4 tdKQ==
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; bh=GjWwvtRB60p+scoH5PrBD2lmPKViMbc0XfXzDKIS+Qo=; b=KZ+PzHnv0PJUaLrjBs7XIWXt/Nd9L74Nh+bVJGqNBG5+VinHfAi6XDBPSo+nAbvQ68 2FTJApul6wKO+M0edXRoQ8Y275+r1MUYlGVekWqEhzY6wZzz/7IAEdLo5/qlotd3S2AM y0yBeHqS5QsWyxE54misUdZAViOveuKe5GhaOTACevoN3yYUoX3vpj6Mic6hWIjlZed0 yu99B7ckLWuVsNu4YU26bnEiFMQ6AzESduJsOXFBVvyIAnPm52ks3o7x/B/BrVn63Zid j0QiUgROcVCy19KEG3MulEKY3ZjCyIntj2M0Sd/cOO3J0ExnS4BcESTrzRxOYEPgN8Ym eJnA==
X-Gm-Message-State: AOAM532DeeoOSqjXAlX0ty9tcrcE+61+/AS1pX8DjCdiKkTCFicxjbGm 0GVa/gZ9r0uu9xfKfKLHwHlN5xLBrbo2z5bhIBUvXYt5AkYfkg==
X-Google-Smtp-Source: ABdhPJxmsf+FnBqCofcleLY1S0Cr4wzK1XChxEZx52LUvix8vlznR2sy3yC1netbCrvaghTuIz8kXVqjTQeNMV32E0M=
X-Received: by 2002:aca:db41:: with SMTP id s62mr1552108oig.54.1619731991054; Thu, 29 Apr 2021 14:33:11 -0700 (PDT)
MIME-Version: 1.0
References: <014e01d73aa1$81aa0d30$84fe2790$@thisisbeacon.com> <5987db79-06a7-69ab-faff-29c763a9a98d@codalogic.com>
In-Reply-To: <5987db79-06a7-69ab-faff-29c763a9a98d@codalogic.com>
From: David Kemp <dk190a@gmail.com>
Date: Thu, 29 Apr 2021 17:32:59 -0400
Message-ID: <CAE5tNmrrk8KjHh7-31Og0x-R+2S_4TQ-K4P+eJutO0p6K57FHg@mail.gmail.com>
To: json@ietf.org
Content-Type: multipart/alternative; boundary="000000000000f54e5d05c1233d46"
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/P89vgyvGoI4ZfzXV2s0ywaUrRMM>
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 21:33:17 -0000

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.
>