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

Nico Williams <nico@cryptonector.com> Thu, 23 May 2013 17:12 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 D224921F95EB for <apps-discuss@ietfa.amsl.com>; Thu, 23 May 2013 10:12:27 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.977
X-Spam-Level:
X-Spam-Status: No, score=-1.977 tagged_above=-999 required=5 tests=[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 y7myl+wXxdsz for <apps-discuss@ietfa.amsl.com>; Thu, 23 May 2013 10:12:10 -0700 (PDT)
Received: from homiemail-a66.g.dreamhost.com (caiajhbdcagg.dreamhost.com [208.97.132.66]) by ietfa.amsl.com (Postfix) with ESMTP id 8768E21F9730 for <apps-discuss@ietf.org>; Thu, 23 May 2013 10:02:56 -0700 (PDT)
Received: from homiemail-a66.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a66.g.dreamhost.com (Postfix) with ESMTP id 4BAF0350072 for <apps-discuss@ietf.org>; Thu, 23 May 2013 10:02:56 -0700 (PDT)
Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com [74.125.82.42]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a66.g.dreamhost.com (Postfix) with ESMTPSA id F27A6350058 for <apps-discuss@ietf.org>; Thu, 23 May 2013 10:02:55 -0700 (PDT)
Received: by mail-wg0-f42.google.com with SMTP id n12so3108496wgh.1 for <apps-discuss@ietf.org>; Thu, 23 May 2013 10:02:54 -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:content-transfer-encoding; bh=WuJcc26o5A9FzqMKfw3Gm9fd1LrTugAbmMd3tyKI6Mo=; b=fdZBkNIwaYNieSGdZ84KUWzXK3kqFtr25raVI4HOrGHFIEGXmBi5JlGkRfdJ1gj/rC lM1ZcMeTes+K/hL+MTmpCfHrtz4jSBhBWzHPPCxsyhzSeV5E+pNVDWVL9YDrPL7w2hjI 2/A+pbcE6v2u17QLNd3lur3VgdT/pIfb72jwqerx47TEPB3BiLwbM6j9vBySrJt1GPth aswYLEkYQodFs2k3lbUq/vbRJIshtEsG9X9nOvC6Bl+q/93p06BLW0NCSYqlbYGlZQUW dIT6AHNUqSuYAfU55w9xXyPyPBLUdPfLr5rd/L4nsgWtbGSvzRjZL1uTNs6YKwxSVflc eLMQ==
MIME-Version: 1.0
X-Received: by 10.180.210.225 with SMTP id mx1mr45740058wic.15.1369328543651; Thu, 23 May 2013 10:02:23 -0700 (PDT)
Received: by 10.216.111.132 with HTTP; Thu, 23 May 2013 10:02:23 -0700 (PDT)
In-Reply-To: <84317001-DB56-4DBE-9D1E-A4E605BC07A0@tzi.org>
References: <61CB1D18-BABC-4C77-93E6-A9E8CDA8326B@vpnc.org> <CAK3OfOhVRqUp+xn8mBj8_x8pgubc7bhWebzsFLvoj+ieWmr5gg@mail.gmail.com> <142483A4-2E80-43F1-B3BE-B5B01650BB8F@tzi.org> <CAK3OfOim44hRaRoFh8vKfK5SPVAnvTGiBV4cizvw30K=ZQPJHQ@mail.gmail.com> <84317001-DB56-4DBE-9D1E-A4E605BC07A0@tzi.org>
Date: Thu, 23 May 2013 12:02:23 -0500
Message-ID: <CAK3OfOj9dH-E1infhUECwgKYQF7ASw1Z21M5oG24PHMLWxuVYw@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: Carsten Bormann <cabo@tzi.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
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 17:12:28 -0000

On Thu, May 23, 2013 at 11:23 AM, Carsten Bormann <cabo@tzi.org> wrote:
> On May 23, 2013, at 17:35, Nico Williams <nico@cryptonector.com> wrote:
>> ECMAScript specifically only allows that.  That's where the
>> restriction comes from.
>
> JSON ≠ JavaScript.

I'm aware.  But defining protocols that can't be implemented in JS
because they use numbers that JS can't represent seems problematic.

>> 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).
>
> Now you lost me -- JSON doesn't have NaNs.
> (Another thing that CBOR has that you can't use in a JSON subset.)

NaN coding is an implementation technique where all values are
internally represented as doubles, with signal bits of NaNs used to
store pointers (for strings, arrays, objects) and representations of
null, true, and false.

>>>> - 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?
>
> Yes, we call them "byte strings" (major type 2).
> (They are actually the main reason I started work on CBOR.)

OK, thanks.