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

Nico Williams <nico@cryptonector.com> Sat, 25 May 2013 03:29 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 D409521F944F for <apps-discuss@ietfa.amsl.com>; Fri, 24 May 2013 20:29:03 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.371
X-Spam-Level:
X-Spam-Status: No, score=-1.371 tagged_above=-999 required=5 tests=[AWL=-0.394, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, J_BACKHAIR_33=1]
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 PXoT8bFB-Gv5 for <apps-discuss@ietfa.amsl.com>; Fri, 24 May 2013 20:28:58 -0700 (PDT)
Received: from homiemail-a64.g.dreamhost.com (caiajhbdcbef.dreamhost.com [208.97.132.145]) by ietfa.amsl.com (Postfix) with ESMTP id DB4A921F9339 for <apps-discuss@ietf.org>; Fri, 24 May 2013 20:28:58 -0700 (PDT)
Received: from homiemail-a64.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a64.g.dreamhost.com (Postfix) with ESMTP id 6B4DF438079 for <apps-discuss@ietf.org>; Fri, 24 May 2013 20:28:58 -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=YEBFX4lHvSHP+qktLDI2 Pl5dR8E=; b=Y1BlM6jpxVvjY7sTUrv2xVNnzw+XKaKVYRMnN9tkhlFK8eWLWTzT gOWf3AdtARhRduzUgidxkh6CI+M3Eh6wFT2rkcxslmBVZLhY2l++DH5MqY3CEd2/ gqP9rqvb2uCC421SnuKgVseuNle7xaWnal4fExkza3PB6ndgr6Gtldo=
Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a64.g.dreamhost.com (Postfix) with ESMTPSA id 1ACF643806C for <apps-discuss@ietf.org>; Fri, 24 May 2013 20:28:57 -0700 (PDT)
Received: by mail-wi0-f172.google.com with SMTP id m6so228359wiv.17 for <apps-discuss@ietf.org>; Fri, 24 May 2013 20:28:56 -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=iWiQaXgtQigqBfIS1ljAkbU0AuTGJ4+3MpxeVVm+AZU=; b=ZcGPO3s394YhBpWV6C4yE+Gt6SugUCwMmFv3kFckbGpQaz9f63OSIJSTAKI9CTNbkd bq6+nojyW5D1Nk0xdi6Pm4SSDeifTO9oollxk+iSBQeMX58fX8ydevUgXL/MpqHI06GU qJFslWgLFUTZ3iNnNmFU91WAGkO0aBAandyQCll5BNZakEzm1MoUft04DIx9yow7CuMK PBHWMf2lAEkLpPqYlXl11Ez+r/E8Q4wMicbruxQV+tsrZdt5BvGTAUyfCk3t28xoplvO iJiRw8SsLCP93dCcWO0vbOyz1ajjOTJp9k0offoyU/UH/u08ejgib2ykqgCKLDpn6Nlw WZqg==
MIME-Version: 1.0
X-Received: by 10.194.77.66 with SMTP id q2mr1535092wjw.34.1369452536497; Fri, 24 May 2013 20:28:56 -0700 (PDT)
Received: by 10.216.63.136 with HTTP; Fri, 24 May 2013 20:28:56 -0700 (PDT)
In-Reply-To: <61CB1D18-BABC-4C77-93E6-A9E8CDA8326B@vpnc.org>
References: <61CB1D18-BABC-4C77-93E6-A9E8CDA8326B@vpnc.org>
Date: Fri, 24 May 2013 22:28:56 -0500
Message-ID: <CAK3OfOiwE0W=AYCtXh7W1RtrvMC4a1KhNDut=tD1ma+ipRrvHw@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: Paul Hoffman <paul.hoffman@vpnc.org>
Content-Type: text/plain; charset="UTF-8"
Cc: 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: Sat, 25 May 2013 03:29:03 -0000

Thinking about what *I* want in a binary JSON encoding, and taking
into account PHB's points about online encoding and decoding, all I
really want, the one thing I badly want, is counted-bytes and chunked
Unicode and octet strings.  That's it.  So picture JSON, complete with
square and curly brackets, but no commas nor colons, just strings
(byte-counted or chunked), some encoding for numbers, booleans, and
null.  It's the handing of scalars that sucks about JSON: string
escaping, number printing and parsing.

Something like this:

{<Unicode string of length 3>foo<Unicode string of length 3>bar<join
to preceding string, length 3>baz<Unicode string of length
3>num<integer value 5>}

as an encoding of { "foo": "barbaz", "num": 5 }, with "barbaz" chunked.

One of the nice things about such an encoding is that it should be
possible to implement as a fairly small variation on existing code:
it's almost only a different way of encoding scalar types -- the only
other difference being that commas and colons are not needed.

With a variable-length encoding of integers and IEEE 754 64-bit
doubles for reals... that's compact enough.  Not nearly as compact as
we could get with schemas and PER-like encodings, but good enough for
a schema-less encoding.

Nico
--