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

Rob Sayre <sayrer@gmail.com> Thu, 18 January 2024 19:56 UTC

Return-Path: <sayrer@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 7FDE3C14CE25; Thu, 18 Jan 2024 11:56:24 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.104
X-Spam-Level:
X-Spam-Status: No, score=-2.104 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_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 (2048-bit key) header.d=gmail.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 JLTJ7ig1yd74; Thu, 18 Jan 2024 11:56:20 -0800 (PST)
Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) (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 DBC84C14F6EF; Thu, 18 Jan 2024 11:56:20 -0800 (PST)
Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a28fb463a28so1358219366b.3; Thu, 18 Jan 2024 11:56:20 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705607779; x=1706212579; 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=GEDjzh3wMoc5AWH+yH+Cb6pebiFMbnTk54s3tXCxtRQ=; b=d1ue/6j8d/Cv5auW0te1Vo6aYsiYmn7/2ZquvjlUUrKwIZiTzUUBTIsU/x2RwlbXus aElPUZtu7r23FOsm8z4t+wv33VHaskrHWFUOpH8XjdN504dWQhlFgKRzD0BLopuMSSjR zNsIzaFDo8DP6JmOjI7rAcwDdyzn9A98UcnjwppBjkk7Sc/UG1xBSAJqWaP7ga9JCp5D My88bqdKl4uwLg1VKRr+ah86C3V+5MiInlYd7E7CR8kYvmJRUylgaRGcL4J/a0lwMQi7 EENGHrxbnp5YNWFmShPUwjlZoFlCC4b129qb3eTzVXhmbXUP1w4459ep1IFEtxU6iPTV bSoQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705607779; x=1706212579; 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=GEDjzh3wMoc5AWH+yH+Cb6pebiFMbnTk54s3tXCxtRQ=; b=MLU98HqN7FJ9HlIX2pYYZLgL0E+yv3mqfKpzikfj1pbLhcnyNv+j3gwYit5/NSDBGV hcMyF2uEZfmLYUr3Hn9ZKD+69ew7Mv0a3NvRlikiYlJPGxRzbJFmBgtmSITC5zFg8Kug BtGZuhz5z7MCR52Nzlw9wBdUADlvAo1ua71y/MNIO/Rv1OGajxS7lN64PIUwlAVklVdw 2djdvoc7Skx2OWMFPKPuwOxwniX/QS2mTVHBCSehteSqbYCJbVGEXeluG9jCt/u2yjir c0OE4odnbBCx7/79ykVSMIApjmsreTfhNfWs5WE4bzQEsyhUNPqVumrfOAYil7z2YTLq 2OtA==
X-Gm-Message-State: AOJu0YzC4KEsT7VzuVkFWljJQ89kGrlPVkVYoQ32LA2kt13aKxDedzYK JT9DNcrXO5S9VUZmuRMAYql8AtBXLGjALW2dzJ4VuAtnP5BwrXUVE0oyZdkISks9Ay26dKiYohl AfdDYtqWhRL39ca5U4lp7omFyCfI=
X-Google-Smtp-Source: AGHT+IEwBh2CZxv+bb8y5BQpRgPcdg2uIOlsgURC3ifjf33kMSgvrjsG7mhgBl/tcX0Y2vAR6GlN1r54Jl3AfeNW/HQ=
X-Received: by 2002:a17:906:fa98:b0:a2e:d71f:bd4c with SMTP id lt24-20020a170906fa9800b00a2ed71fbd4cmr821113ejb.68.1705607778419; Thu, 18 Jan 2024 11:56:18 -0800 (PST)
MIME-Version: 1.0
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> <0BB09B30-B606-44CC-85DC-95A47E485316@cursive.net> <B22EDB2D-0AD1-4582-9191-EFB40E163F19@tzi.org> <F6EB02CA-C240-4FA1-92A8-C5BB883929C7@cursive.net> <29BD1557-59A1-4578-901B-C626ABBE9A78@tzi.org>
In-Reply-To: <29BD1557-59A1-4578-901B-C626ABBE9A78@tzi.org>
From: Rob Sayre <sayrer@gmail.com>
Date: Thu, 18 Jan 2024 11:56:06 -0800
Message-ID: <CAChr6Sw+-WZUzhA6D8D0qs_QLH22-hkTfecmJJzLadvJZDewsA@mail.gmail.com>
To: Carsten Bormann <cabo@tzi.org>
Cc: Joe Hildebrand <hildjj@cursive.net>, "json@ietf.org" <json@ietf.org>, cbor@ietf.org
Content-Type: multipart/alternative; boundary="000000000000c248b6060f3dc186"
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/3Vqz4LXrbZEtLtEz2YXTvEVBXqE>
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: Thu, 18 Jan 2024 19:56:24 -0000

Hi,

I thought I might also add that I use <https://serde.rs> for most of these
tasks these days.

Sometimes, I do use what they call "field attributes":
https://serde.rs/field-attrs.html

You need these so your deserialized structs pass all of the common linter
tests.

I don't think this way of doing things would extend to a document format
like HTML or XML, but you can certainly cover JSON, YAML, and CBOR with it.
So, I now rarely interact with a parser for those kinds of things, and thus
I'm agnostic on any wire format particulars.

thanks,
Rob


On Thu, Jan 18, 2024 at 5:57 AM Carsten Bormann <cabo@tzi.org> wrote:

> Hi Joe,
>
> thanks for the list!
> I’m CCing cbor@, as we are just finishing the extended diagnostic
> notation (EDN) document, and it is worth considering these points.
>
> > We would need to rework that grammar to make it suitable for interchange:
>
> [context: as a JSON extension]
>
> > - Remove encoding indicators as mentioned
>
> Right.  When you say “remove”, you mean “do not include in JSON subset”?
> (ABNF doesn’t have the “.feature” feature of CDDL…)
>
> > - Reference IEEE754 for the 0x1.2p3 format, or remove it
>
> Good point.  Section 5.12.3 of IEEE Std 754-2019?
>
> > - Remove embedded notation
>
> (I.e., not in JSON subset.)
>
> > - Remove ellipsis processing
>
> (I.e., not in JSON subset.)
>
> > - Discuss whether results should always be an array, as sequence is
> currently top-level
>
> Good question.  I gather the pickup of JSON sequences (RFC 7464) is not
> that great?  EDN is not entirely compatible with that as we don’t do the RS
> character, but do an explicit comma.
> The JSON subset could simply use “item” as the entry point.
>
> > - Discuss adding other JSON5 features
>
> Do you have some examples for what you would like to add?
> What are we missing out for EDN?
>
> > We wouldn't get Tim's desired property of one character look-ahead.
>
> On constrained systems, you could always use CBOR…
>
> > Other than that, it's as good a place to start as anywhere else.
>
> Indeed.
> I could imagine we finish the EDN-literal document for its CBOR target
> audience, and then write another document about the JSON subset (which
> would be less of a delta and more of a free-standing specification that is
> just anchored in the full version for CBOR).
>
> I just noticed that we do have a required comma between items in arrays
> and sequences.  I just confused this with CDDL (which I’m prone to do),
> where that comma is not required.  Leaving off the comma conflicts with
> implicit string concatenation (which is one way to address the 2D string
> problem).  So maybe there is a bit more work to do...
>
> Grüße, Carsten
>
> _______________________________________________
> json mailing list
> json@ietf.org
> https://www.ietf.org/mailman/listinfo/json
>