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

Phillip Hallam-Baker <hallam@gmail.com> Fri, 24 May 2013 18:08 UTC

Return-Path: <hallam@gmail.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 CCA3C21F9673 for <apps-discuss@ietfa.amsl.com>; Fri, 24 May 2013 11:08:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, HTML_MESSAGE=0.001, NO_RELAYS=-0.001]
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 uatxNVnL4wlp for <apps-discuss@ietfa.amsl.com>; Fri, 24 May 2013 11:08:25 -0700 (PDT)
Received: from mail-la0-x229.google.com (mail-la0-x229.google.com [IPv6:2a00:1450:4010:c03::229]) by ietfa.amsl.com (Postfix) with ESMTP id 5047721F93C4 for <apps-discuss@ietf.org>; Fri, 24 May 2013 11:08:25 -0700 (PDT)
Received: by mail-la0-f41.google.com with SMTP id ee20so4782957lab.14 for <apps-discuss@ietf.org>; Fri, 24 May 2013 11:08:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Ga+o3Y1iKjf82YqKrgCxWkMrjBkC//TBk6i5R21eudI=; b=IQXiAQeGDcwyfUR98OgCtz9CpuhHBe7vfAOvLvvs7aJK7oFQhlVrmto27k3TaW28FB dI6IP7lQB9LyJqDlrp6uLQfc2DSfqkE47n8vvtESrSvVIhUkerBJa28zYDkIP4RQaKDP Lj/4xDJ4qlwvrlYdeyg482IlVTKH/20Py1g7mFqaxxrYDHerc3XyB1gRRLf8AOlktjE8 uwj2WA6/ar4XhhaGRz0hLcCVMsI6MbGpumGxf7XX+KOaJ7cfn9uwbX0fA7m2MGBuuORM F6XnmvxM2PPpRXEJAEcV4h67yh5lgOvOApGKC/4Mk9rR8csJIwAM32D/gFry/oHGvruv SP6w==
MIME-Version: 1.0
X-Received: by 10.152.21.40 with SMTP id s8mr6662537lae.6.1369418904096; Fri, 24 May 2013 11:08:24 -0700 (PDT)
Received: by 10.112.200.169 with HTTP; Fri, 24 May 2013 11:08:23 -0700 (PDT)
In-Reply-To: <CAK3OfOgV8Gr7iWVHJ396kRfdvY+6k84uKXdLM6VKKMuO0T8Sbg@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>
Date: Fri, 24 May 2013 14:08:23 -0400
Message-ID: <CAMm+Lwi6kyWjPF5S9hEJAk9RuiJsyN4FVqJ0vOWU4YcsKgdang@mail.gmail.com>
From: Phillip Hallam-Baker <hallam@gmail.com>
To: Nico Williams <nico@cryptonector.com>
Content-Type: multipart/alternative; boundary="089e0141a4a453d7f204dd7aafa9"
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:08:26 -0000

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.

The advantage to that approach is that it can be used by a transcoder that
has a fixed buffer size converting from JSON to the binary encoding.


It would be fairly easy to add to BSON as they have plenty of unused code
points. The existing scheme is not very satisfactory as they represent
lengths as fixed 32 bit integers!! Kind of disappointing when a single
video file can easily be over 4Gb. Or at least would be if most equipment
didn't have to dance around brain dead file systems with the same
limitation.


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.

-- 
Website: http://hallambaker.com/