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

Nico Williams <nico@cryptonector.com> Fri, 24 May 2013 18:43 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 2966F11E80EE for <apps-discuss@ietfa.amsl.com>; Fri, 24 May 2013 11:43:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.857
X-Spam-Level:
X-Spam-Status: No, score=-1.857 tagged_above=-999 required=5 tests=[AWL=0.120, 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 WEM9w8+36Pcv for <apps-discuss@ietfa.amsl.com>; Fri, 24 May 2013 11:43:47 -0700 (PDT)
Received: from homiemail-a90.g.dreamhost.com (caiajhbdcbhh.dreamhost.com [208.97.132.177]) by ietfa.amsl.com (Postfix) with ESMTP id 4D1D511E80EC for <apps-discuss@ietf.org>; Fri, 24 May 2013 11:43:47 -0700 (PDT)
Received: from homiemail-a90.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a90.g.dreamhost.com (Postfix) with ESMTP id 0919B2AC075 for <apps-discuss@ietf.org>; Fri, 24 May 2013 11:43:43 -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=pnq6Flc6D223+WltFSjK HdnXWN4=; b=XL1wAn4cVyVAFXLaCoyfYA605bNBfKZB2PoXr/7mPDPpb6e+fZqr pRaGkHChiloT8VQazGXJIc8qULRiZB/XzX5/rP+kBmrc31nh4phVsSpcKufiQUEO Uspz89u/1iIiGIu77C4CRlNJ1w2WbcR0m06fpySBvNagyeglToG748g=
Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a90.g.dreamhost.com (Postfix) with ESMTPSA id C3B0A2AC085 for <apps-discuss@ietf.org>; Fri, 24 May 2013 11:43:12 -0700 (PDT)
Received: by mail-wi0-f171.google.com with SMTP id hq7so74032wib.4 for <apps-discuss@ietf.org>; Fri, 24 May 2013 11:43:11 -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=i2QU+jGNSmDSgCOQq/Bc8OHEzxL4g/9jTmmMhK5QTSw=; b=ioAoRbgUC2uJHMGW+A2kQvu2i4dcxfWSlpHawgB7lyI+YDS4hoEdtpUNE5nRLncP7Q TOjBV+4KAyPNpezNjAJr/wUjeGJG+JO8msRDM61zsbCfd6pbzzV6/9DUSbHUTcIlBhwE ncvGH3EOCX1S0bCcWgOA2gDuyyUR0+8E0J+YTooZNbmLviIAv6ONBos83mzZx6qHaXPC pDphvH3/re9ERPR2CcNCIrgQULDrQoSe3A38MRBIZjJxu/U/jlZhca0TLDVUM/t8zyle Eb04MrqPb6JjYROIRSwW5OoJozhcT78gVKVWQkmkzjEsGpAFyEUC2VDZo0XJ91oRg4PV C7YA==
MIME-Version: 1.0
X-Received: by 10.180.184.83 with SMTP id es19mr278076wic.54.1369420991149; Fri, 24 May 2013 11:43:11 -0700 (PDT)
Received: by 10.217.133.83 with HTTP; Fri, 24 May 2013 11:43:10 -0700 (PDT)
In-Reply-To: <CAMm+Lwi6kyWjPF5S9hEJAk9RuiJsyN4FVqJ0vOWU4YcsKgdang@mail.gmail.com>
References: <CAMm+LwiWYLBS+H6oKCfByUJVXL8bk293WuFY_M2fnBM2iuvxGA@mail.gmail.com> <A723FC6ECC552A4D8C8249D9E07425A70FC0DB40@xmb-rcd-x10.cisco.com> <CAMm+Lwg6GN+eE59+eo8HkBkfaH+Y-V6=DqK-eyaucFycHd4emw@mail.gmail.com> <CAK3OfOgV8Gr7iWVHJ396kRfdvY+6k84uKXdLM6VKKMuO0T8Sbg@mail.gmail.com> <CAMm+Lwi6kyWjPF5S9hEJAk9RuiJsyN4FVqJ0vOWU4YcsKgdang@mail.gmail.com>
Date: Fri, 24 May 2013 13:43:10 -0500
Message-ID: <CAK3OfOh+O3Dcg7N8ZQZ16w74T6nxoO4jb8xjsErVjr8FVogJLw@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: Phillip Hallam-Baker <hallam@gmail.com>
Content-Type: text/plain; charset="UTF-8"
Cc: "apps-discuss@ietf.org Discuss" <apps-discuss@ietf.org>, Paul Hoffman <paul.hoffman@vpnc.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: Fri, 24 May 2013 18:43:52 -0000

On Fri, May 24, 2013 at 1:08 PM, Phillip Hallam-Baker <hallam@gmail.com> wrote:
> On Fri, May 24, 2013 at 1:53 PM, Nico Williams <nico@cryptonector.com>
> wrote:
>>
>> > BSON does not do that quite like I would like but I can fake the same
>> > effect
>> > by using an array of Binary rather than one Binary chunk and the same
>> > for
>> > strings.
>>
>> I think that's as well as you can expect to do without having to
>> resort to escaping binary/string characters.
>
>
> The alternative would be to declare new data types for chunked strings and
> chunked binary which would be closed by an end marker.

Ah, sure, turn strings (bytes or Unicode) into arrays of chunks.

> Sure counts of items are better than ASN.1's counts of bytes. But I can't
> see any utility in the counts of objects either. If you are trying to
> navigate to a particular point in the structure you are going to have to
> parse the whole stream regardless. The only way you could skip over a whole
> object to go onto the next would be with something like the ASN.1 definite
> length scheme.

Sure, that's nice, but it sucks for the encoder.