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

Tim Bray <tbray@textuality.com> Wed, 17 January 2024 16:44 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 99DC4C151064 for <json@ietfa.amsl.com>; Wed, 17 Jan 2024 08:44:28 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.106
X-Spam-Level:
X-Spam-Status: No, score=-2.106 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_DNSWL_NONE=-0.0001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, 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 Ye_Uj-GYfkCo for <json@ietfa.amsl.com>; Wed, 17 Jan 2024 08:44:24 -0800 (PST)
Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (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 56B7DC14CE24 for <json@ietf.org>; Wed, 17 Jan 2024 08:44:24 -0800 (PST)
Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-557ad92cabbso11352610a12.0 for <json@ietf.org>; Wed, 17 Jan 2024 08:44:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=textuality.com; s=google; t=1705509862; x=1706114662; 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=r2KgNYlP0k8T+XtKshwkHGguMg8zgXZe1FpoGCEB/9U=; b=Sz8lZqrUKeDCEuMkVC2Kmv2f2/5Mr4y8+6ltCRdf8F7mNdO9i8YAiQgTAC13UlIkEk LrFSDNNtWdOmVxlBUguOINIfB0GNs2FM0233CLSpLYIeDWdvg4M+SFi5nJgFq+fLupjd Wjl85QHC8SVUS4eazR31FzK9zT7IluJB+w8Qs=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705509862; x=1706114662; 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=r2KgNYlP0k8T+XtKshwkHGguMg8zgXZe1FpoGCEB/9U=; b=b9FjYAZAW12nHd3tRrkRDY3EZKgoC6l9cG+SMCqrM4MVStdEQqdlA8tFrGkPPFEi2L gih1NnVuLfmFNeN9j5q4qGiL2kREzGzdeLcauHmdtyY4bvGugnq+Iu7CkcwoKEIVjh3y jgJriFOtRfEuSM14/AyDn2RY0W+gGj/t1ZNjL5xcEZSAu83Iu6/SCSPLXvHhABggyk7/ qHHu4RMch+a3uYTCC1/EE5Ie48riNFeufAkEZDu74d5Og9yq+xcj0AcmeYYLZMxV0yAt rMninEPcyaBZH1UeF6WwraCvBwPd3O/xWKbR/xDX3bGuI33xslCchhdYIjfxP8J3AyY4 RYKQ==
X-Gm-Message-State: AOJu0YyVXHKAIMk4JJgC5udxgI6Rw1u9Zaqs8r6YGJUW6URH//PwkWHL EvPMuG2/BnijSHmN8z4928H9vPjsuNO1YQXM+NNINDvEGEMqWQ==
X-Google-Smtp-Source: AGHT+IGjUkkpJOxbybwddDg4R0Rjs3GG000bqBXch0ai4Mp2LGWBRBXSj8PWyPEghaWJ1KwrBiE7N1KGUnmk5thqCng=
X-Received: by 2002:a50:fb8f:0:b0:559:deef:86dd with SMTP id e15-20020a50fb8f000000b00559deef86ddmr274852edq.30.1705509861990; Wed, 17 Jan 2024 08:44:21 -0800 (PST)
Received: from 1064022179695 named unknown by gmailapi.google.com with HTTPREST; Wed, 17 Jan 2024 11:44:20 -0500
Received: from 1064022179695 named unknown by gmailapi.google.com with HTTPREST; Wed, 17 Jan 2024 11:44:17 -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>
In-Reply-To: <09233A73-3A6B-4E6F-AEB8-596AC6442E24@cursive.net>
From: Tim Bray <tbray@textuality.com>
Date: Wed, 17 Jan 2024 11:44:20 -0500
Message-ID: <CAHBU6ivWPoJ5jUgvnXG=Ei+kh6yYXsBykKGs8cneSN0w9PCTyw@mail.gmail.com>
To: Joe Hildebrand <hildjj@cursive.net>
Cc: "json@ietf.org" <json@ietf.org>, Pete Cordell <petejson@codalogic.com>
Content-Type: multipart/alternative; boundary="0000000000007c3804060f26f553"
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/1gblnj1CTLtP-KQoAPOZhSS68MA>
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 16:44:28 -0000

On Jan 17, 2024 at 8:28:40 AM, Joe Hildebrand <hildjj@cursive.net> wrote:

> I've got something working in Peggy (https://peggyjs.org <
> https://peggyjs.org/>) with a couple minutes of work.  I can publish it
> if it's useful.
>
> Or, start with
> https://github.com/peggyjs/peggy/blob/main/examples/json.pegjs and hack
> in whatever features you want.
>
> The approach that seems right to me is to make it explicit; bigint's get
> suffixed with 'n', and there is not automatic promotion to break existing
> code.
>

I think prefix not suffix? A nice thing about parson JSON is that you can
tell what kind of thing a value is by looking at its first character.


> If we were to add Date (which is absolutely the most important after
> bigint), I might want the other JS built-in types as well.  I wonder if we
> could reuse the CBOR tag registry, and make Date stringify to:
>
> 0('2024-01-17T16:26:23Z')
> or
> dt('2024-01-17T16:26:23Z')
>

I’d do @2024-01-17T16:26:23Z

>
>