Re: [Cbor] Updated Drafts for dCBOR I-D and Gordian Envelope Structured Data Format I-D & IANA Tag Registration
Carsten Bormann <cabo@tzi.org> Wed, 31 May 2023 10:35 UTC
Return-Path: <cabo@tzi.org>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9C8D7C151B13 for <cbor@ietfa.amsl.com>; Wed, 31 May 2023 03:35:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.899
X-Spam-Level:
X-Spam-Status: No, score=-6.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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 QOBw9TCnmjfZ for <cbor@ietfa.amsl.com>; Wed, 31 May 2023 03:35:21 -0700 (PDT)
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 D819AC151076 for <cbor@ietf.org>; Wed, 31 May 2023 03:35:18 -0700 (PDT)
Received: from smtpclient.apple (p548dc0f6.dip0.t-ipconnect.de [84.141.192.246]) (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 4QWQdG0M6HzDCcb; Wed, 31 May 2023 12:35:14 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <EA5A4131-F715-437C-A9AD-FF6220D1A3B3@wolfmcnally.com>
Date: Wed, 31 May 2023 12:35:03 +0200
Cc: "cbor@ietf.org" <cbor@ietf.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <EC48004E-8A52-4F32-ACF2-865A3911156E@tzi.org>
References: <CAAse2dEFB_FVP6_KkNANSYPW+yX4-M9pN3YkUq5=FTgLZnyWGw@mail.gmail.com> <4EBE3640-5F7F-46B8-961A-D1872A6A0CA4@tzi.org> <463016EF-0DAB-45D4-AB30-53FB2B76F52B@wolfmcnally.com> <DD0E7621-EE3A-496E-9D2C-1CD00E2D92F9@tzi.org> <PH0PR02MB7256A94640C7C02C75C3795FF2779@PH0PR02MB7256.namprd02.prod.outlook.com> <62FCDF82-9766-431F-A996-BF820D5564C5@island-resort.com> <EA5A4131-F715-437C-A9AD-FF6220D1A3B3@wolfmcnally.com>
To: Wolf McNally <wolf@wolfmcnally.com>
X-Mailer: Apple Mail (2.3731.600.7)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/zJeyImDFmd8SVswmJV0mbW_wlSg>
Subject: Re: [Cbor] Updated Drafts for dCBOR I-D and Gordian Envelope Structured Data Format I-D & IANA Tag Registration
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 31 May 2023 10:35:25 -0000
On 31. May 2023, at 10:22, Wolf McNally <wolf@wolfmcnally.com> wrote: > > *must* support BigNum A quick comment on this misconception: “Support BigNum” is not a binary yes/no. It is in no way harder to decode 1b 00 00 00 10 00 00 00 00 into 68719476736 than it is to decode c2 45 10 00 00 00 00 into the same number. (That doesn’t mean that we’d always want to encode things this way; I’m just trying to correct the misconception. The shortest CBOR encoding of the above mathematical value is fa 51 80 00 00 but many decoders would present this as a number of a different platform type, 68719476736.0, to the application.) The discussion here is mostly about how to map application data types into elements of the CBOR generic data model, and back (often on a different platform!). On some platforms, the mapping is so obvious that it just doesn’t come up as a question. Some platforms provide challenges, however: - Lua doesn’t distinguish arrays and maps. Some heuristic might help, or an explicit indication from the application. - JavaScript doesn’t distinguish int and float, but then also has another separate int type, bigint. One might be tempted to map bigint into CBOR bignums, and do a mechanized mapping of the single number datatype into int and float. One problem with the latter is that not all CBOR integers (even without bignum) can be mapped into JavaScript’s 53-bit numbers. In any case, this is a challenge where some heuristic might help, or an explicit indication from the application. In the platform mapping, the question is how the CBOR number types (besides the three I mentioned, there are tag 4 and 5 as well) are related to each other, specifically, how fungible they are. RFC 7049 was leaning towards placing int and float into the same bin (like dCBOR does), and we learned enough in the first seven years of CBOR that we are no longer favoring this in RFC 8949. The line between int and bignum was always very thin (we essentially didn’t want to provide i128/u128 as a special case, so put this into bignum); a platform that has i128/u128 might very well map some bignums into these. Most 64-bit only platforms need separate types for uint64 and int64, and then still need a third for the lower half of nint64. And so on. What I’m trying to point out here is that mixing this issue with deterministic encoding might be blurring it more than helping. In the end, the application is interested in creating interoperable CBOR, and in the most general case it will need API primitives to get some control over what encoding is generated. We probably want to minimize this, but can’t for all platforms (see Lua). Grüße, Carsten
- [Cbor] Updated Drafts for dCBOR I-D and Gordian E… Christopher Allen
- Re: [Cbor] Updated Drafts for dCBOR I-D and Gordi… Carsten Bormann
- Re: [Cbor] Updated Drafts for dCBOR I-D and Gordi… Wolf McNally
- Re: [Cbor] Updated Drafts for dCBOR I-D and Gordi… Carsten Bormann
- Re: [Cbor] Updated Drafts for dCBOR I-D and Gordi… Jeremy O'Donoghue
- Re: [Cbor] Updated Drafts for dCBOR I-D and Gordi… Laurence Lundblade
- Re: [Cbor] Updated Drafts for dCBOR I-D and Gordi… Wolf McNally
- Re: [Cbor] Updated Drafts for dCBOR I-D and Gordi… Jeremy O'Donoghue
- Re: [Cbor] Updated Drafts for dCBOR I-D and Gordi… Carsten Bormann
- Re: [Cbor] Updated Drafts for dCBOR I-D and Gordi… Christian Amsüss
- Re: [Cbor] Updated Drafts for dCBOR I-D and Gordi… Carsten Bormann
- [Cbor] draft-mcnally-deterministic-cbor: rational… Christian Amsüss
- Re: [Cbor] draft-mcnally-deterministic-cbor: rati… Carsten Bormann
- Re: [Cbor] draft-mcnally-deterministic-cbor: rati… Carsten Bormann
- Re: [Cbor] Updated Drafts for dCBOR I-D and Gordi… Anders Rundgren
- Re: [Cbor] Updated Drafts for dCBOR I-D and Gordi… Carsten Bormann
- Re: [Cbor] Updated Drafts for dCBOR I-D and Gordi… Wolf McNally
- Re: [Cbor] Updated Drafts for dCBOR I-D and Gordi… Wolf McNally
- Re: [Cbor] Updated Drafts for dCBOR I-D and Gordi… Christopher Allen