Re: [Cbor] correctness of implied top level array?

Joe Hildebrand <jhildebrand@mozilla.com> Thu, 28 February 2019 19:23 UTC

Return-Path: <jhildebrand@mozilla.com>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id AD431130FA5 for <cbor@ietfa.amsl.com>; Thu, 28 Feb 2019 11:23:31 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=mozilla.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uPc6oM1sqXSC for <cbor@ietfa.amsl.com>; Thu, 28 Feb 2019 11:23:29 -0800 (PST)
Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7AB65130FA2 for <cbor@ietf.org>; Thu, 28 Feb 2019 11:23:29 -0800 (PST)
Received: by mail-ed1-x532.google.com with SMTP id m35so17931332ede.10 for <cbor@ietf.org>; Thu, 28 Feb 2019 11:23:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mozilla.com; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=FsRVZ7HjqSaIpa7EeRUByVLtE0QkciC5fWOcCI4cRrQ=; b=C2x1/tKNk+RtgteqTVCUXTID7ZMnMp0rZ1fNEB1Z17awMFQNsEh0XB0NGzfqx75dpb I0lc7e2BC93hU25UBekUKXsCVzvs++w4iYzEljPgDY36/IdqDe/rH54kMlkAWoBXd3C4 7y4yUg125qnOydXEKMQH0YnQ8FmKFZ5Jbzqds=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=FsRVZ7HjqSaIpa7EeRUByVLtE0QkciC5fWOcCI4cRrQ=; b=ebXCTT4+ni0K6hvxZpmqLuq/6YiYUDmwPPdIJ0O21IuPqtj27Z4jRGglolYAsTGp+F bezj58nBmH6c3qdIG74KVXcLpUh+f4HmLtvSzPyxxLEJfULegvvydvvqHJwlXyn80NQ0 eJxV+HHlQaNjD7Czr6kVZRjBp4+SE4ip18nIf7MPhIZBDTpSrapBRKa8ROOP8tpWWTG6 fFcRVC4kQ6aGoEae6ks6hcvMQ39reVNSvLYXZAn+PvdpNg6+MUqriOKA2oKXSfvKzVjo yiGPF0uvMg963Y7VBKXP3caMVo8N7eGr6EagBnDVf02Uavu50aoNhkFLcHPC8FkF5hhK AKlg==
X-Gm-Message-State: APjAAAUmhYXbRn4J1TcJOut0RYpY/UFkVTIwkfwtn0wmryUnzcriRJmL rMuWpN+j+XbHeHCnUW+nXO86OSAmCw8=
X-Google-Smtp-Source: APXvYqxTwv59WYtNp/kDkmLAncF85mgDI9/XxRVu2el6qOg32LyfAvQVnm6YuYw5xyIjOjIx45DRyw==
X-Received: by 2002:a50:eb4a:: with SMTP id z10mr982631edp.284.1551381807820; Thu, 28 Feb 2019 11:23:27 -0800 (PST)
Received: from [10.6.18.59] ([207.126.127.114]) by smtp.gmail.com with ESMTPSA id u49sm5441108edm.37.2019.02.28.11.23.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Feb 2019 11:23:26 -0800 (PST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\))
From: Joe Hildebrand <jhildebrand@mozilla.com>
In-Reply-To: <9644.1551315204@localhost>
Date: Thu, 28 Feb 2019 12:23:24 -0700
Cc: Carsten Bormann <cabo@tzi.org>, cbor@ietf.org, Laurence Lundblade <lgl@island-resort.com>
Content-Transfer-Encoding: quoted-printable
Message-Id: <01396AC3-0EDE-4AEC-B60E-1274B9E66C52@mozilla.com>
References: <81789050-5133-48B0-BEE7-4F1E0BBB4C06@island-resort.com> <40A3B694-80A4-4AD7-A2A6-C071C6E88D2D@tzi.org> <F0A06813-3F1F-4D53-80A1-4CBBBB91DC64@island-resort.com> <0A96C82A-85DB-411D-812D-5A3479A8EA87@mozilla.com> <052FFFD1-6145-4451-91A0-B07ED0AEC726@tzi.org> <9644.1551315204@localhost>
To: Michael Richardson <mcr+ietf@sandelman.ca>
X-Mailer: Apple Mail (2.3445.102.3)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/_W95spfCBsNE6kdrVphXhGgWgYY>
Subject: Re: [Cbor] correctness of implied top level array?
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Feb 2019 19:23:32 -0000

> On Feb 27, 2019, at 5:53 PM, Michael Richardson <mcr+ietf@sandelman.ca> wrote:
> 
> An alternative way to do the desired action (and bring this inside of cbor)
> would be an (indefinite?) array type that was specified to concatenate.
> 
> I'm not really arguing for this, but I think it's worth knowing why this
> would be less good a thing.

It's an interesting idea.  One of the reasons this didn't feel right to me was that my initial take on indefinite-length arrays was to read the whole array, growing memory as needed.  I've moved on from that, but would expect others to find themselves in a similar spot.

More interestingly though, there are times when I might want to use an optional external length-framing approach, like embedding a single CBOR data item in a WebSocket message.

— 
Joe Hildebrand