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

Carsten Bormann <cabo@tzi.org> Wed, 17 January 2024 08:17 UTC

Return-Path: <cabo@tzi.org>
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 6E9A4C14CF0C for <json@ietfa.amsl.com>; Wed, 17 Jan 2024 00:17:14 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.896
X-Spam-Level:
X-Spam-Status: No, score=-1.896 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
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 ElysXn8w2gOd for <json@ietfa.amsl.com>; Wed, 17 Jan 2024 00:17:08 -0800 (PST)
Received: from smtp.zfn.uni-bremen.de (smtp.zfn.uni-bremen.de [IPv6:2001:638:708:32::21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 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 D1775C14F5F5 for <json@ietf.org>; Wed, 17 Jan 2024 00:17:05 -0800 (PST)
Received: from eduroam-0298.wlan.uni-bremen.de (eduroam-0298.wlan.uni-bremen.de [134.102.17.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4TFJd940X4zDCfm; Wed, 17 Jan 2024 09:17:01 +0100 (CET)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <CAHBU6itRMhFk-38LPnB=c4vjZuDEp+UVXiQPzKrCwVmugUizag@mail.gmail.com>
Date: Wed, 17 Jan 2024 09:17:01 +0100
Cc: Joe Hildebrand <hildjj@cursive.net>, "json@ietf.org" <json@ietf.org>
X-Mao-Original-Outgoing-Id: 727172221.005805-1de67dff791626af99997876dd1f2dd7
Content-Transfer-Encoding: quoted-printable
Message-Id: <34BA1D1B-450B-4AF3-9AD0-780ADD3249B0@tzi.org>
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> <CAHBU6itRMhFk-38LPnB=c4vjZuDEp+UVXiQPzKrCwVmugUizag@mail.gmail.com>
To: Tim Bray <tbray@textuality.com>
X-Mailer: Apple Mail (2.3608.120.23.2.7)
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/Mggfj-MiKH99SSUQ3wcQAKFlGQQ>
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 08:17:14 -0000

On 2024-01-17, at 06:01, Tim Bray <tbray@textuality.com> wrote:
> 
> […] I’ve never managed to convince myself that the advantages of binary over text are worth the aggravation.

Eleven years ago, I would probably have sympathized with this sentiment.
When I worked with SGML and later XML, I was so happy to replace ASN.1 and a boatload of ad-hoc binary formats with a text-based format.
JSON certainly could (mostly) displace XML only because it also kept the tradition of being text-based.

However, this is no longer the world we live in.

Today, we are using all kinds of tools to look at interchanged data.
Even JSON is usually packed for interchange and needs a pretty-printing tool to be useful as a text-based format.
CBOR diagnostic notation is a way to pretty-print CBOR that is as useful (upwards compatible with JSON, and, by the way, now [1] fixes most of the really jarring aspects of JSON that we inherited).

HTTP started as a text-based format in the 1990s, and we have since made an almost complete transition to HTTP/2 and HTTP/3, which use binary representation.  

Most of our interchanges today are encrypted anyway; this and other crypto content (signatures, keys, endorsements…) lead to tons of base64 (or worse, hex!) content in nominally “text-based” formats.  Again, a tool is needed to look at these.

The age where text-based formats were to be preferred for interchange is pretty much over.

CBOR diagnostic notation shows that you can have the remaining crumbs of that cake and eat the simplicity of the binary cake, too.

Grüße, Carsten

[1]: https://datatracker.ietf.org/doc/draft-ietf-cbor-edn-literals/