Re: [apps-discuss] Concise Binary Object Representation (CBOR)

Carsten Bormann <> Thu, 23 May 2013 16:40 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id F409C21F969E for <>; Thu, 23 May 2013 09:40:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -106.486
X-Spam-Status: No, score=-106.486 tagged_above=-999 required=5 tests=[AWL=-0.237, BAYES_00=-2.599, HELO_EQ_DE=0.35, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 0RoRW7raMsmO for <>; Thu, 23 May 2013 09:40:04 -0700 (PDT)
Received: from ( [IPv6:2001:638:708:30c9::12]) by (Postfix) with ESMTP id D5F6321F9783 for <>; Thu, 23 May 2013 09:38:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
Received: from ( []) by (8.14.4/8.14.4) with ESMTP id r4NGcA6l022904; Thu, 23 May 2013 18:38:10 +0200 (CEST)
Received: from [] ( []) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPSA id ED7783067; Thu, 23 May 2013 18:38:09 +0200 (CEST)
Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\))
Content-Type: text/plain; charset="iso-8859-1"
From: Carsten Bormann <>
In-Reply-To: <>
Date: Thu, 23 May 2013 18:38:09 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <>
References: <> <>
To: Nico Williams <>
X-Mailer: Apple Mail (2.1503)
Cc: Paul Hoffman <>,
Subject: Re: [apps-discuss] Concise Binary Object Representation (CBOR)
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: General discussion of application-layer protocols <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Thu, 23 May 2013 16:40:20 -0000

On May 23, 2013, at 18:13, Nico Williams <> wrote:

> Also, I believe this is the fifth binary encoding of JSON proposed
> thus far.  

1) CBOR is not a "binary encoding of JSON".
(It can be used as one, though.)

2) There are many more proposals in this space, and it is hard to draw a line.
E.g. Google protocol buffers is a prominent example.
Bencode is a great one, too.

> An analysis of these might be nice.

Yes.  Find a grad student :-)

Of course, I did my own analysis, but I didn't see a need to write it up.
(More specifically, I didn't see a funding agency interested in this part of reality.
But I'm willing to be surprised :-)

> (While you're at that, and considering variable length encodings of
> things... SQLite4 has some really neat variable length encodings of
> all its data types, specifically designed to make sorting via memcmp()
> possible.  I'm not sure what relevance that might have here, but it
> should be of interest to anyone designing variable length encodings of
> anything.)

If you are looking for a neat variable length encoding of integers designed to sort well, look no further than Appendix A.4 of draft-bormann-coap-misc.
But CBOR wasn't trying to be neat, it is trying to be practical.

> I do agree that we need a schema-less encoding (which means we can't
> get as good as PER and friends).  We probably don't need a
> schema-capable encoding for JSON (though that might be nice).  We do
> need schema-aware encodings for some protocols, but we have plenty
> already, and none are nor need to be JSONish.

I think we are in good agreement here.

Grüße, Carsten