Subject: [Cbor] Tag for (mathematical) sets

From: Carsten Bormann <[email-masked]>
Date: Fri, 25 Aug 2017 12:06:02 +0200

Several implementation environments have a data type for sets of items (sets in the mathematical sense).
These generally are represented in CBOR by putting the items in an array.
Today, there is no way to identify that array as a set, so a generic CBOR decoder cannot put back the items into whatever the implementation environment uses for representing sets, without help from the application.

There is a proposal for registering such a tag:
https://github.com/input-output-hk/cbor-sets-spec/blob/master/CBOR_SETS.md

I don’t think any WG action is needed here except for the FYI.

However, this proposal raises one question in the context of the discussions we have had:
This proposal currently uses FCFS space, i.e. the tag is represented in three bytes.
Should we encourage the authors to go for the “specification required” space (a two-byte tag)?

Sets are fundamental enough that there should be no question about wide applicability.
While some sets are large (and a short tag therefore doesn’t make a difference for them), some aren’t.

Any opinions on this?

(I believe the authors would also welcome comments to the spec right at the github repo.)

Grüße, Carsten

---

From: "Paul Hoffman" <[email-masked]>
Date: Fri, 25 Aug 2017 08:05:52 -0400

On 25 Aug 2017, at 6:06, Carsten Bormann wrote:

> Today, there is no way to identify that array as a set, so a generic 
> CBOR decoder cannot put back the items into whatever the 
> implementation environment uses for representing sets, without help 
> from the application.
>

No, but it's fine to alert them of the possibility.

> difference for them), some aren’t.

Even if a set is "not large", an extra byte is not a lot for a set. A 
developer is already incurring an overhead by tagging at all.

--Paul Hoffman