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

Nico Williams <nico@cryptonector.com> Thu, 23 May 2013 15:35 UTC

Return-Path: <nico@cryptonector.com>
X-Original-To: apps-discuss@ietfa.amsl.com
Delivered-To: apps-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id EA18C21F96C9 for <apps-discuss@ietfa.amsl.com>; Thu, 23 May 2013 08:35:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.777
X-Spam-Level:
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 mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p6uilspb+d8D for <apps-discuss@ietfa.amsl.com>; Thu, 23 May 2013 08:35:35 -0700 (PDT)
Received: from homiemail-a77.g.dreamhost.com (caiajhbdcbbj.dreamhost.com [208.97.132.119]) by ietfa.amsl.com (Postfix) with ESMTP id 2166A21F96C1 for <apps-discuss@ietf.org>; Thu, 23 May 2013 08:35:35 -0700 (PDT)
Received: from homiemail-a77.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a77.g.dreamhost.com (Postfix) with ESMTP id E76BF9405E for <apps-discuss@ietf.org>; Thu, 23 May 2013 08:35:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h= mime-version:in-reply-to:references:date:message-id:subject:from :to:cc:content-type; s=cryptonector.com; bh=QLnmfFYnXmEh8PwYiRFj UngU+rM=; b=fc1CB+M/wJma1S+tjUVI3dCojTqFsIfTHx531i+63lwyoe246m4I o1/lgXHrKnsIb+NQGR2y9G5w8tmzzl8PCFiqmE17cpAq7ywOo0JojMTYt3PbGJUX B8MuYgS7SWdMD7kDZjvXKI+tTtose0BsHj0d1lVhiVDvgtKKQ1lFBQA=
Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a77.g.dreamhost.com (Postfix) with ESMTPSA id 96E299405C for <apps-discuss@ietf.org>; Thu, 23 May 2013 08:35:34 -0700 (PDT)
Received: by mail-wi0-f175.google.com with SMTP id hn14so4651564wib.2 for <apps-discuss@ietf.org>; Thu, 23 May 2013 08:35:33 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; 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 10.180.72.195 with SMTP id f3mr44006549wiv.32.1369323333391; Thu, 23 May 2013 08:35:33 -0700 (PDT)
Received: by 10.216.111.132 with HTTP; Thu, 23 May 2013 08:35:33 -0700 (PDT)
In-Reply-To: <142483A4-2E80-43F1-B3BE-B5B01650BB8F@tzi.org>
References: <61CB1D18-BABC-4C77-93E6-A9E8CDA8326B@vpnc.org> <CAK3OfOhVRqUp+xn8mBj8_x8pgubc7bhWebzsFLvoj+ieWmr5gg@mail.gmail.com> <142483A4-2E80-43F1-B3BE-B5B01650BB8F@tzi.org>
Date: Thu, 23 May 2013 10:35:33 -0500
Message-ID: <CAK3OfOim44hRaRoFh8vKfK5SPVAnvTGiBV4cizvw30K=ZQPJHQ@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: Carsten Bormann <cabo@tzi.org>
Content-Type: text/plain; charset="UTF-8"
Cc: Paul Hoffman <paul.hoffman@vpnc.org>, apps-discuss@ietf.org
Subject: Re: [apps-discuss] Concise Binary Object Representation (CBOR)
X-BeenThere: apps-discuss@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: General discussion of application-layer protocols <apps-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/apps-discuss>
List-Post: <mailto:apps-discuss@ietf.org>
List-Help: <mailto:apps-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 23 May 2013 15:35:41 -0000

On Thu, May 23, 2013 at 2:15 AM, Carsten Bormann <cabo@tzi.org> wrote:
> On May 23, 2013, at 07:27, Nico Williams <nico@cryptonector.com> 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
this).

>> - 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?

Nico
--