Re: [Cbor] Consolidated set of tags for map-like entities

Kio Smallwood <kio@mothers-arms.co.uk> Mon, 15 March 2021 19:36 UTC

Return-Path: <kio@mothers-arms.co.uk>
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 468BC3A0A87 for <cbor@ietfa.amsl.com>; Mon, 15 Mar 2021 12:36:56 -0700 (PDT)
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, HTML_MESSAGE=0.001, KHOP_HELO_FCRDNS=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 00SO8h87LnNT for <cbor@ietfa.amsl.com>; Mon, 15 Mar 2021 12:36:54 -0700 (PDT)
Received: from authenticated.a-painless.mh.aa.net.uk (painless-a.thn.aa.net.uk [IPv6:2001:8b0:62::26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E08E23A09BE for <cbor@ietf.org>; Mon, 15 Mar 2021 12:36:53 -0700 (PDT)
Received: from a-webmail.thn.aa.net.uk ([2001:8b0:62::22] helo=webmail.aa.net.uk) by painless-a.thn.aa.net.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from <kio@mothers-arms.co.uk>) id 1lLt1I-0002nf-KV; Mon, 15 Mar 2021 19:36:52 +0000
Received: from cpc105076-sgyl40-2-0-cust233.18-2.cable.virginm.net ([82.4.24.234]) by webmail.aa.net.uk with HTTP (HTTP/1.1 POST); Mon, 15 Mar 2021 19:36:49 +0000
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="=_9f071d2974764d67f5c23074322e8050"
Date: Mon, 15 Mar 2021 19:36:49 +0000
From: Kio Smallwood <kio@mothers-arms.co.uk>
To: Emile Cormier <emile.cormier.jr@gmail.com>
Cc: cbor@ietf.org
In-Reply-To: <CAM70yxC7o3CNz67Yx3-yLt3tPQaTRaezOO99Ssa-3ppu-NwD=Q@mail.gmail.com>
References: <CAM70yxC7o3CNz67Yx3-yLt3tPQaTRaezOO99Ssa-3ppu-NwD=Q@mail.gmail.com>
Message-ID: <d9790cc20ed6ef267e656ab7b4f8492f@mothers-arms.co.uk>
X-Sender: kio@mothers-arms.co.uk
User-Agent: Roundcube Webmail/1.3.16
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/dJzLewI_8K9-01m8VeDehac1PDM>
Subject: Re: [Cbor] Consolidated set of tags for map-like entities
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
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: Mon, 15 Mar 2021 19:37:03 -0000

Hi Emile, 

Thanks for enumerating all of the possibilities. I have a few thoughts: 

* Would it be worth noting which programming languages and environments
already make use of each type? For example, users of the cbor2 python
library would only see tag 128 (equivalent to major type 5) tag 129,
130, for ordered and multimaps, and 132 when inter-operating with
javascript/json. The rest would be very strange to encounter in a Python
datastructure. 

* For the Homogeneous keys/values, should we (codec implementers) assume
that the type of the first key/value encountered in the data item
determines the type of the remainder? 

Thanks, 

Kio 

On 2021-03-12 23:50, Emile Cormier wrote:

> Hi Everyone, 
> 
> I've been corresponding privately with Prof. Bormann about a new tag I proposed for encoding multimaps as arrays or pairs. He's made me aware of your recent discussion about another proposed tag for encoding "ordered" maps, where the insertion order must be preserved. Carsten has indicated to me his desire to consolidate all of these map-related tags together. 
> 
> I would like to contribute to this endeavor of consolidating map-related tags. To get the discussion started, I would like to share with you a draft proposal I've written to serve as a starting point: https://github.com/ecorm/cbor-map-like 
> 
> Here's a brief summary: 
> 
>> This document proposes a consolidated set of CBOR tags for map-like entities involving key-value pairs. These tags encode the following meta-data concerning map-like entities: 
>> 
>> * the homogeneity of the key and value types,
>> * the preservation of the insertion order of the key-value pairs,
>> * the uniqueness of the keys, and,
>> * the major type used to encode the key-value pairs.
> 
> My interest in CBOR stems from my work on a new C++ serialization library that can support any JSON-like encoding. This library is closed source for now, but I may be able to convince my employer to make it open source in the future. 
> 
> I'm also involved with the WAMP protocol, which allows CBOR as one of its encodings. 
> 
> I'm looking forward to collaborating with you and I hope that we can come to a solution that satisfies everyone's needs. 
> 
> Cheers, 
> Emile Cormier 
> _______________________________________________
> CBOR mailing list
> CBOR@ietf.org
> https://www.ietf.org/mailman/listinfo/cbor