Re: [Json] JSON and int64s - any change in current best practice since I-JSON

Tim Bray <tbray@textuality.com> Wed, 17 January 2024 18:32 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 9693BC14F698 for <json@ietfa.amsl.com>; Wed, 17 Jan 2024 10:32:34 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.105
X-Spam-Level:
X-Spam-Status: No, score=-2.105 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, HTML_MESSAGE=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=textuality.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2y5WknLT5b3N for <json@ietfa.amsl.com>; Wed, 17 Jan 2024 10:32:30 -0800 (PST)
Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3ED77C151980 for <json@ietf.org>; Wed, 17 Jan 2024 10:32:30 -0800 (PST)
Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2cddf596321so24708731fa.0 for <json@ietf.org>; Wed, 17 Jan 2024 10:32:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=textuality.com; s=google; t=1705516348; x=1706121148; darn=ietf.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=hCo5u11ABYjMXRYlakFTsFbPxt9JpTjdjbIoQqlEoDE=; b=GNIuhU3fuR7afQQSYHouyvw0v6PtdZiTwwzaZkstkhxQvgRN899RGIeUzm5mpVs/m4 vh4+y2VVKNgeUX4gx5oWWbjpb5oYC3SUOSP1kXPjU1EQzq6OIICU4Px9GqWpgNpDcHZJ 77Hyw5kLJg/RdR1tAkurojKWrolnbNJI+9r7o=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705516348; x=1706121148; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hCo5u11ABYjMXRYlakFTsFbPxt9JpTjdjbIoQqlEoDE=; b=IOCbcPkfSvsaKzZ0tkQ6znzavznVXo9/oddVV8SFye7S3AV3oCMvqM/ohYmg30dVnl riTSJ9amtn519nb1IkRg+r5emXAeVEsKUfAc9fMAn+CQhf7Km5UJa7gv38SZeGeR2CHl bfAKvftG2cxI/JU/vPTBPrm6QMg4lCKfvx7R5bFpDCPEPUjRenyPR8PJpZHeuAeJMAZY +m7eqmaoEtORH9Jk27eBrTpv7+aG5GGua/DdTwJ6XfXHplN0/PWOOM0zK4D8QcO/Toa7 GtQlrHgf5rLjaiMu0t+MUtwrgeb+ikvI8h3iOYEEhrWuDiUavdik4rASnkd0l1IQI0Tf 0BdA==
X-Gm-Message-State: AOJu0Yxytu3fDzVPy1dKaLJ3NVgM+wcYf8PGCHS2OFyjpKF3xq5UZW/v vUZ8JlxlOUiG21N9KFAkPtHlGS3Su/cpRn/V0oTVHJFFIXJMkw==
X-Google-Smtp-Source: AGHT+IFVKKJJTAk6ZP8RDFmaKgg0bCPlGS2EAFhzxg00/oFiifzDq7VjhruNzplpe/pTAtQPI8pn5A+rAoWkV3QQbik=
X-Received: by 2002:a2e:c51:0:b0:2cd:9959:53a0 with SMTP id o17-20020a2e0c51000000b002cd995953a0mr4275195ljd.1.1705516347500; Wed, 17 Jan 2024 10:32:27 -0800 (PST)
Received: from 1064022179695 named unknown by gmailapi.google.com with HTTPREST; Wed, 17 Jan 2024 13:32:26 -0500
Received: from 1064022179695 named unknown by gmailapi.google.com with HTTPREST; Wed, 17 Jan 2024 13:32:22 -0500
MIME-Version: 1.0 (Mimestream 1.2.4)
References: <87527a42-aaac-4f39-b320-05f18a2808c1@codalogic.com> <C31BF4C8-9E6C-48F8-BF7B-D2C379273B3F@tzi.org> <CAHBU6it4SaLawSiBgK9ySkbxjtHE6CX-P3r=hzcVy4ksoQo-Cg@mail.gmail.com> <CAChr6SxHfLW-A1asAndKJz-AiyJv5QP18bi=_bNdKXw7zYHThw@mail.gmail.com> <CAChr6SweYdCWxSABZ7g20Zd-xBFzcK0Ritq53S7WtjSwc-vLmw@mail.gmail.com> <E5A68370-CC2F-4618-AB39-39A382656616@cursive.net> <807fea1b-a22b-4d6b-aa5d-720c9b12023c@codalogic.com> <09233A73-3A6B-4E6F-AEB8-596AC6442E24@cursive.net> <869950DC-647B-4481-AEF8-9E092384E99F@tzi.org> <CBD32B58-8328-4602-89C6-BC2A7A875A0D@cursive.net> <994E2C0A-4AE0-4720-8C67-913BBF033E11@tzi.org> <CAHBU6isiUhvhk5VPpQ1A_kGDJZhsGLc1xkyu6pNeLUBHw2_dzg@mail.gmail.com> <0D9273E3-A07F-4303-9AF7-89375FDC2496@tzi.org> <CAChr6Sw=em9poOXTEsYzxbFHSRsrWzFyZof50X4Tca0E2Fecuw@mail.gmail.com>
In-Reply-To: <CAChr6Sw=em9poOXTEsYzxbFHSRsrWzFyZof50X4Tca0E2Fecuw@mail.gmail.com>
From: Tim Bray <tbray@textuality.com>
Date: Wed, 17 Jan 2024 13:32:26 -0500
Message-ID: <CAHBU6it4rvnYQGnrwrigAtL05O7SH2coRrq91Si1xr3u7oC47w@mail.gmail.com>
To: Rob Sayre <sayrer@gmail.com>
Cc: Pete Cordell <petejson@codalogic.com>, "json@ietf.org" <json@ietf.org>, Joe Hildebrand <hildjj@cursive.net>, Carsten Bormann <cabo@tzi.org>
Content-Type: multipart/alternative; boundary="0000000000000d4096060f287850"
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/FCu75X-iSfKWto8yVq-NoTZEhG0>
Subject: Re: [Json] JSON and int64s - any change in current best practice since I-JSON
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.39
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: Wed, 17 Jan 2024 18:32:34 -0000

 If there were going to be an ESON effort, the hills I’d die on are:


   1. Lose the commas
   2. @-prefixed date stamp
   3. B-prefixed bigint
   4. I could live with i-prefixed and f-prefixed integers and floats if
   people cared but the JSON “number” abstraction has never got in my way
   5. Comments are totally not necessary


But this is a fever dream, JSON has been JSON for many years and probably
has more technical inertia than all the other data formats put together.

On Jan 17, 2024 at 9:27:30 AM, Rob Sayre <sayrer@gmail.com> wrote:

> On Wed, Jan 17, 2024 at 9:03 AM Carsten Bormann <cabo@tzi.org> wrote:
>
>> On 2024-01-17, at 17:57, Tim Bray <tbray@textuality.com> wrote:
>> >
>> >
>> >
>> > On Jan 17, 2024 at 8:54:40 AM, Carsten Bormann <cabo@tzi.org> wrote:
>> >>
>> >> What *is* a “local bigint type” in Rust?  Ruby?  Erlang?
>> >
>> > An integer of unbounded size, no?
>>
>> But 1 is not of unbounded size, so I don’t understand what 1n means.
>>
>> The syntax 1n seems to assume that the target platform has a separable
>> type for those integers of unbounded size.  That doesn’t work with
>> platforms where integers of unbounded size aren’t anything special.  It is
>> also weird with platforms that have many bounded types to choose from (is
>> i128 OK for 1n?).
>>
>
> I still think CBOR would be better here, because you can cover all this
> stuff:
>
> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Typed_arrays#typed_array_views
>
> and get Blobs:
> https://developer.mozilla.org/en-US/docs/Web/API/Blob
>
> and Dates:
> https://www.rfc-editor.org/rfc/rfc8949.html#section-3.4.1
>
> The BigInt in JSON issue is widely duplicated in the TC39 Github, so I do
> agree the problem is real. Might as well really go after all of this stuff
> at once, though.
>
> thanks,
> Rob
>