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

Nico Williams <> Thu, 23 May 2013 15:35 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id EA18C21F96C9 for <>; Thu, 23 May 2013 08:35:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.777
X-Spam-Status: No, score=-1.777 tagged_above=-999 required=5 tests=[AWL=0.200, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id p6uilspb+d8D for <>; Thu, 23 May 2013 08:35:35 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id 2166A21F96C1 for <>; Thu, 23 May 2013 08:35:35 -0700 (PDT)
Received: from (localhost []) by (Postfix) with ESMTP id E76BF9405E for <>; Thu, 23 May 2013 08:35:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed;; h= mime-version:in-reply-to:references:date:message-id:subject:from :to:cc:content-type;; bh=QLnmfFYnXmEh8PwYiRFj UngU+rM=; b=fc1CB+M/wJma1S+tjUVI3dCojTqFsIfTHx531i+63lwyoe246m4I o1/lgXHrKnsIb+NQGR2y9G5w8tmzzl8PCFiqmE17cpAq7ywOo0JojMTYt3PbGJUX B8MuYgS7SWdMD7kDZjvXKI+tTtose0BsHj0d1lVhiVDvgtKKQ1lFBQA=
Received: from ( []) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: by (Postfix) with ESMTPSA id 96E299405C for <>; Thu, 23 May 2013 08:35:34 -0700 (PDT)
Received: by with SMTP id hn14so4651564wib.2 for <>; Thu, 23 May 2013 08:35:33 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=86IXu4QU4uvJE0QRCZl5KZ6g2/xZrQD6gCzdttdif/4=; b=Fi/RiJhJlR3ZIyiOg7YuiHRu7wn1s15DKUep238PU2Da+BhrpPlR1NQazGrQLJCODF I8vPiqIYdxIFeVMusjrQt3FrDbo9z+A0+UIDf4ejuhBtQ0slt0HyHrvliQ6HDR81txp8 KI3ZvYo0O/O6Lhm1Jwi1olPUCTAvIhkB0F9VKwWtaW9CT0PaC3frX/xKX4kqxLQf1EzA 4CmvmlPxeOAntF4mRDA94FhZYNHORqum9LpPcfRPAw+PxE1ih1cp4Sy+i9MYE1y53aJJ ue3gABnnmu56hpWuWDx0DvkZHay8eTo0mXD5DzvuR1Or3j4D/Y1Wy8HBuXOYrZgM8qic q7LA==
MIME-Version: 1.0
X-Received: by with SMTP id f3mr44006549wiv.32.1369323333391; Thu, 23 May 2013 08:35:33 -0700 (PDT)
Received: by with HTTP; Thu, 23 May 2013 08:35:33 -0700 (PDT)
In-Reply-To: <>
References: <> <> <>
Date: Thu, 23 May 2013 10:35:33 -0500
Message-ID: <>
From: Nico Williams <>
To: Carsten Bormann <>
Content-Type: text/plain; charset="UTF-8"
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 15:35:41 -0000

On Thu, May 23, 2013 at 2:15 AM, Carsten Bormann <> wrote:
> On May 23, 2013, at 07:27, Nico Williams <> wrote:
>> - yeah, multiple ways of encoding a given value suck; in particular,
>> for the JSON-equivalent subset, there should be only doubles, no
>> floats, no integers
> This is about like saying there should only ever be 64-bit integers (or 128-bit, while we are at it).

ECMAScript specifically only allows that.  That's where the
restriction comes from.

Many a ECMAScript and/or JSON implementation use NaN coding, which is
probably why this restriction is there in the first place (though
that's just a guess; I'm sure there's a list archive somewhere with a
lengthy discussion I could check; I don't care).

> The serializer can choose one of multiple representations (or, if it is expedient, it can stick with one).
> Like with different size of integers, there is little effort in a deserializer to support different sizes of floats.

I wouldn't insist on having a canonical representation.  I would
prefer to have a canonical representation if possible.  The biggest
issue would be the need to sort object keys, which I'd not insist on
(but it's nice to have the option to, and many a JSON encoder provides

>> - might as well have a type for "octet string" -- no base64 encoding please
> Yes, we are just not using the liturgical name "octet string" :-)

Yes it's there and I missed it?