Re: If not JSON, what then ?

"Poul-Henning Kamp" <phk@phk.freebsd.dk> Tue, 02 August 2016 12:06 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 B9A2B12D0EA for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 2 Aug 2016 05:06:42 -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 UetB9FhFT1EE for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 2 Aug 2016 05:06:41 -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 6DFDA12D54D for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 2 Aug 2016 05:06:41 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1bUYOy-0003UZ-Nc for ietf-http-wg-dist@listhub.w3.org; Tue, 02 Aug 2016 12:02:28 +0000
Resent-Date: Tue, 02 Aug 2016 12:02:28 +0000
Resent-Message-Id: <E1bUYOy-0003UZ-Nc@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 <phk@phk.freebsd.dk>) id 1bUYOu-0003To-9c for ietf-http-wg@listhub.w3.org; Tue, 02 Aug 2016 12:02:24 +0000
Received: from phk.freebsd.dk ([130.225.244.222]) by maggie.w3.org with esmtp (Exim 4.80) (envelope-from <phk@phk.freebsd.dk>) id 1bUYOm-0007Az-Em for ietf-http-wg@w3.org; Tue, 02 Aug 2016 12:02:23 +0000
Received: from critter.freebsd.dk (unknown [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id 801D3273C2; Tue, 2 Aug 2016 12:01:52 +0000 (UTC)
Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTP id u72C1oYt063869; Tue, 2 Aug 2016 12:01:50 GMT (envelope-from phk@phk.freebsd.dk)
To: Mark Nottingham <mnot@mnot.net>
cc: HTTP Working Group <ietf-http-wg@w3.org>
In-reply-to: <12ED69B4-C924-475E-9432-B8FEB4B9DF80@mnot.net>
From: Poul-Henning Kamp <phk@phk.freebsd.dk>
References: <77778.1470037414@critter.freebsd.dk> <12ED69B4-C924-475E-9432-B8FEB4B9DF80@mnot.net>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <63867.1470139310.1@critter.freebsd.dk>
Content-Transfer-Encoding: quoted-printable
Date: Tue, 02 Aug 2016 12:01:50 +0000
Message-ID: <63868.1470139310@critter.freebsd.dk>
Received-SPF: none client-ip=130.225.244.222; envelope-from=phk@phk.freebsd.dk; helo=phk.freebsd.dk
X-W3C-Hub-Spam-Status: No, score=-6.0
X-W3C-Hub-Spam-Report: AWL=-0.826, BAYES_00=-1.9, RP_MATCHES_RCVD=-1.243, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: maggie.w3.org 1bUYOm-0007Az-Em 94de61b115dbd0d49516bc0498153b81
X-Original-To: ietf-http-wg@w3.org
Subject: Re: If not JSON, what then ?
Archived-At: <http://www.w3.org/mid/63868.1470139310@critter.freebsd.dk>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/32131
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>

--------
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 ??"
 
>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.

>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.

>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

>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 ?  :-)

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

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.