Re: If not JSON, what then ?

Mark Nottingham <mnot@mnot.net> Tue, 02 August 2016 13:45 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6A60D12D600 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 2 Aug 2016 06:45:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -8.208
X-Spam-Level:
X-Spam-Status: No, score=-8.208 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.287, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
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 3AlNU7dHdQ3E for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 2 Aug 2016 06:45:57 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C1FD012D5F6 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 2 Aug 2016 06:45:57 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1bUZ8L-0005t1-SV for ietf-http-wg-dist@listhub.w3.org; Tue, 02 Aug 2016 12:49:21 +0000
Resent-Date: Tue, 02 Aug 2016 12:49:21 +0000
Resent-Message-Id: <E1bUZ8L-0005t1-SV@frink.w3.org>
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <mnot@mnot.net>) id 1bUZ8H-0005rj-43 for ietf-http-wg@listhub.w3.org; Tue, 02 Aug 2016 12:49:17 +0000
Received: from mxout-08.mxes.net ([216.86.168.183]) by maggie.w3.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from <mnot@mnot.net>) id 1bUZ80-0002v1-IO for ietf-http-wg@w3.org; Tue, 02 Aug 2016 12:49:11 +0000
Received: from [192.168.98.220] (unknown [62.154.197.60]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 7A05550A73; Tue, 2 Aug 2016 08:48:36 -0400 (EDT)
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
From: Mark Nottingham <mnot@mnot.net>
In-Reply-To: <63868.1470139310@critter.freebsd.dk>
Date: Tue, 02 Aug 2016 14:48:34 +0200
Cc: HTTP Working Group <ietf-http-wg@w3.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <48B021E6-5AA2-4075-9E16-A9F837CA512F@mnot.net>
References: <77778.1470037414@critter.freebsd.dk> <12ED69B4-C924-475E-9432-B8FEB4B9DF80@mnot.net> <63868.1470139310@critter.freebsd.dk>
To: Poul-Henning Kamp <phk@phk.freebsd.dk>
X-Mailer: Apple Mail (2.3124)
Received-SPF: pass client-ip=216.86.168.183; envelope-from=mnot@mnot.net; helo=mxout-08.mxes.net
X-W3C-Hub-Spam-Status: No, score=-9.6
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, W3C_AA=-1, W3C_DB=-1, W3C_IRA=-1, W3C_IRR=-3, W3C_WL=-1
X-W3C-Scan-Sig: maggie.w3.org 1bUZ80-0002v1-IO b26f4452e07d7bed8efea24e98d77211
X-Original-To: ietf-http-wg@w3.org
Subject: Re: If not JSON, what then ?
Archived-At: <http://www.w3.org/mid/48B021E6-5AA2-4075-9E16-A9F837CA512F@mnot.net>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/32140
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

> On 2 Aug 2016, at 2:01 PM, Poul-Henning Kamp <phk@phk.freebsd.dk> wrote:
> 
> --------
> In message <12ED69B4-C924-475E-9432-B8FEB4B9DF80@mnot.net>, Mark Nottingham wri
> tes:
> 
>> A few thoughts come to mind:
>> 
>> 1) Using the first character of the field-value as a signal that the 
>> encoding is in use is interesting. I was thinking of indicating it with 
>> a suffix on the header field name (e.g., Date-J).
> 
> Yeah, that could work too, but I suspect it would be more cumbersome
> to implement, and it creates a new class of mistakes which need to
> be detected  - "Both Date and Date-J ??"

See separate discussion. 

> 
>> 2) Regardless of #1, using < as your indicator character is going to 
>> collide with the existing syntax of the Link header.
> 
> If Link is "<> blacklisted" in the IANA registry, that wouldn't be a
> problem, and all currently defined headers will need to be checked
> against some kind of white/black list, if we want them to use the
> new "common structure".
> 
> I picked <> because they were a cheap balanced pair in HPACK/huffman
> and I only found Link that might cause a false positive.
> 
> Strictly speaking, it doesn't have to be a balanced pair, it could
> even be control-characters but HPACK/huffman punish those hard.
> 
> I didn't dare pick () even though it had even shorter HPACK/huffman.
> 
> Thinking about it now, I can't recall any headers starting with a '('
> so () might be better than <> and thus avoid the special case of Link.

That might work.

> 
>> 3) I really, really wonder whether we need recursion beyond one level; 
> 
> As do I.
> 
> However, if it is recursion, the implementation cost is very low,
> and I would prefer to "deliver tools, not policy" and let people
> recurse until they hurt if they want.
> 
> I particular do not want to impose complexity limits on private
> headers, based on the simplicity of public headers, because my
> experience is that private headers are more complex.
> 
> I would prefer a simple, general model, restricted by machine
> readable schemas, rather than a complex model with built in
> limitations.

Nod.

Right now, most implementations limit header field values on length; if they start limiting on recursion as well, it would be good to have a reasonable value specified (or at least suggested).


>> 4) I agree with the sentiment that non-ascii strings in header field 
>> values are comparatively rare (since most headers are not intended for 
>> display), so while we should accommodate them, they shouldn't be the 
>> default.
> 
> That was the idea behind: \U  Make people explicitly tag UTF8

Ok.

>> 5) I like the idea of 'implicit angle brackets' to retrofit some 
>> existing headers. Depending on the parse algorithm we define, we could 
>> potentially fit a fair number of existing headers into this, although 
>> deriving the specific data types of things like parameter arguments is 
>> going to be difficult (or maybe impossible). Needs some investigation 
>> before we know whether this would be viable.
> 
> Schemas!  Have I mentioned already how smart I think schemas usable
> to build code with would be ?  :-)

So it's really "implicit angle brackets plus a reference to a retrofitted schema". OK. 

Get on another train and start working on that schema language. :)


> PS: I had expected you to ask if was trying to sabotage your Key header :-)

That's one of the reasons I complained about arbitrary recursion.

However, whatever happens here, I think we have to accept that Key will not be able to address all header fields; it's always going to be a subset. If a particular header field wants to leverage Key, it'll need to be specified within its capabilities (provided it gets traction, of course).

Cheers,


--
Mark Nottingham   https://www.mnot.net/