Re: [apps-discuss] Gen-ART review of draft-bormann-cbor-04

Carsten Bormann <cabo@tzi.org> Tue, 13 August 2013 14:29 UTC

Return-Path: <cabo@tzi.org>
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 43DC021E816C; Tue, 13 Aug 2013 07:29:06 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -106.249
X-Spam-Level:
X-Spam-Status: No, score=-106.249 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, HELO_EQ_DE=0.35, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
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 e4LUUbz5AcDU; Tue, 13 Aug 2013 07:29:00 -0700 (PDT)
Received: from informatik.uni-bremen.de (mailhost.informatik.uni-bremen.de [IPv6:2001:638:708:30c9::12]) by ietfa.amsl.com (Postfix) with ESMTP id 637C521E811A; Tue, 13 Aug 2013 07:28:49 -0700 (PDT)
X-Virus-Scanned: amavisd-new at informatik.uni-bremen.de
Received: from smtp-fb3.informatik.uni-bremen.de (smtp-fb3.informatik.uni-bremen.de [134.102.224.120]) by informatik.uni-bremen.de (8.14.4/8.14.4) with ESMTP id r7DESIAN000411; Tue, 13 Aug 2013 16:28:18 +0200 (CEST)
Received: from [192.168.217.105] (p5489267F.dip0.t-ipconnect.de [84.137.38.127]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp-fb3.informatik.uni-bremen.de (Postfix) with ESMTPSA id 75E1F4CC; Tue, 13 Aug 2013 16:28:18 +0200 (CEST)
Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\))
Content-Type: text/plain; charset="iso-8859-1"
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <alpine.LSU.2.00.1308131200210.6019@hermes-2.csi.cam.ac.uk>
Date: Tue, 13 Aug 2013 16:28:17 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <BA3B1C2C-DF2A-4DC8-8F9D-9E915BAB1BF4@tzi.org>
References: <CABkgnnXtCBHnOpY_=t7yWD-+7rSFHKdUi0VGUSVJqXq+xV-G2g@mail.gmail.com> <D16097AF-5DFB-4F6A-A6E7-2582C1CF25CD@tzi.org> <alpine.LSU.2.00.1308131200210.6019@hermes-2.csi.cam.ac.uk>
To: Tony Finch <dot@dotat.at>
X-Mailer: Apple Mail (2.1508)
Cc: "ietf@ietf.org Mailing List" <ietf@ietf.org>, IETF Apps Discuss <apps-discuss@ietf.org>
Subject: Re: [apps-discuss] Gen-ART review of draft-bormann-cbor-04
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: Tue, 13 Aug 2013 14:29:06 -0000

On Aug 13, 2013, at 13:14, Tony Finch <dot@dotat.at> wrote:

> Type tags don't really need to
> be part of the serialization format: they can be encoded in a simpler
> format by the application. 

Yes, and we also can get rid of maps {"a": 1, "b": 2}.

Just represent them as arrays of two-element arrays [["a", 1], ["b", 2]].
Or, actually, as arrays where the even-indexed elements are the keys ["a", 1, "b", 2].
(This is, in the end, close to what happens in the encoder anyway.)

There is a reason why we provide some type tagging (here: distinguish arrays and maps) in the encoding: The decoder may be able to factor out some common handling that otherwise would need to be done on the application.

In other words, removing maps in the name of simplicity just moves the complexity elsewhere, in this case to the application.

Now, the application may already be prepared to handle the complexity, and if you come from a JSON world, you are probably *used* to having it handle the equivalent of CBOR's tags in the application: JSON doesn't have tags.  Supporting applications that do that is a reason why the use of tags is optional.

Grüße, Carsten