Re: If not JSON, what then ?

Martin Thomson <martin.thomson@gmail.com> Wed, 03 August 2016 12:55 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 C770612D197 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 3 Aug 2016 05:55:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -8.308
X-Spam-Level:
X-Spam-Status: No, score=-8.308 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, 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
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 bTdRpVhoU2yL for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 3 Aug 2016 05:55:04 -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 B605012D0A1 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Wed, 3 Aug 2016 05:55:03 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1bUvd9-0001Pa-T9 for ietf-http-wg-dist@listhub.w3.org; Wed, 03 Aug 2016 12:50:39 +0000
Resent-Date: Wed, 03 Aug 2016 12:50:39 +0000
Resent-Message-Id: <E1bUvd9-0001Pa-T9@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 <martin.thomson@gmail.com>) id 1bUvd4-0001Iu-49 for ietf-http-wg@listhub.w3.org; Wed, 03 Aug 2016 12:50:34 +0000
Received: from mail-qt0-f170.google.com ([209.85.216.170]) by maggie.w3.org with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <martin.thomson@gmail.com>) id 1bUvcz-000611-Nq for ietf-http-wg@w3.org; Wed, 03 Aug 2016 12:50:33 +0000
Received: by mail-qt0-f170.google.com with SMTP id x25so141507907qtx.2 for <ietf-http-wg@w3.org>; Wed, 03 Aug 2016 05:50:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=pBsZrujir/BUiYdCitbco8BcVMSAbBYCwwZGFVwlmGk=; b=rTWKhNyscSyjvmDE1xpOPEq/Op+GQgi8Iq6PFVDwKiYFk4LxqoT/7Nc1WAdadj9gk6 ZOUwL3YQXbh8ORTSYuPr5UDY92nhdTqZSAI/N33uwz7KCoOky0oR1207b//K/L/O/QaH kvtYDpHvssLIGFWr9qMc6FHnU831uLEBWBdsoQT9SQIRF2O9w3LJe0X1VHRTqwk5wFwZ kj4O/oAosEMnPpC7Et75JPavvMCsBIIfqCys9TDL3U/1AfEf2fbtRjl3uJ/tZaXVq4VF UNVXuffwIjfM3LV9Puui6sGcXv92RJbPZtbzb45PveM8lp4wJnRQnTUHAucNIMJNMryr 8wRA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=pBsZrujir/BUiYdCitbco8BcVMSAbBYCwwZGFVwlmGk=; b=MDy1kZ/jysoC0BxuksX7GgKhRMOpNtS5FvzhosbZ7x//9cYtkryX+SoG6VXFebLfwE EStPQBXhmXTGXl2IWcIFRxlzFnju3Tyqs9901uZxHqF2oeNZCqHldhq83HKQ+pTmqixo 3A/KtxLO9FLoB5iT6e4cPr3OmD+zlekQNfCQq3a5O6Zhsf2YKJ9bgX+CJp3js+D/MuwI MhGB54tOzPCFfWT9DAdXTS3XPwK7vaXa8StQ9aYx787PDTky75bPmMcb04Xv949zna1x RhHVBxYZuGkj2mEOcCACyjsUNTcdzuLMpjGmVXblxRDcS4FrjyM0VSvGmEOM9mRNvPU2 1w2g==
X-Gm-Message-State: AEkoouukoUQxHJLDXTXS+knvszPX+2m4eM7JtU9APhX9pXr8ckmGXnPrsAcZoP795q8e0jByUQh5lA63ThE0Sw==
X-Received: by 10.200.50.82 with SMTP id y18mr103718742qta.29.1470228602972; Wed, 03 Aug 2016 05:50:02 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.140.22.146 with HTTP; Wed, 3 Aug 2016 05:50:01 -0700 (PDT)
In-Reply-To: <20160803094554.GE500@1wt.eu>
References: <12ED69B4-C924-475E-9432-B8FEB4B9DF80@mnot.net> <20160803063730.EDABAF792@welho-filter3.welho.com> <20160803064633.GB500@1wt.eu> <201608030937.u739bpxx007542@shell.siilo.fmi.fi> <20160803094554.GE500@1wt.eu>
From: Martin Thomson <martin.thomson@gmail.com>
Date: Wed, 03 Aug 2016 14:50:01 +0200
Message-ID: <CABkgnnWqHTinXDNXxM7Lw9SBGCCPb-j6BgKF=wjWKXRUbfe1oQ@mail.gmail.com>
To: Willy Tarreau <w@1wt.eu>
Cc: Kari hurtta <hurtta-ietf@elmme-mailer.org>, HTTP working group mailing list <ietf-http-wg@w3.org>, Mark Nottingham <mnot@mnot.net>, Poul-Henning Kamp <phk@phk.freebsd.dk>
Content-Type: text/plain; charset="UTF-8"
Received-SPF: pass client-ip=209.85.216.170; envelope-from=martin.thomson@gmail.com; helo=mail-qt0-f170.google.com
X-W3C-Hub-Spam-Status: No, score=-7.9
X-W3C-Hub-Spam-Report: AWL=1.832, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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 1bUvcz-000611-Nq d017bd276271aaf8de5f6370065b2189
X-Original-To: ietf-http-wg@w3.org
Subject: Re: If not JSON, what then ?
Archived-At: <http://www.w3.org/mid/CABkgnnWqHTinXDNXxM7Lw9SBGCCPb-j6BgKF=wjWKXRUbfe1oQ@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/32170
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 3 August 2016 at 19:45, Willy Tarreau <w@1wt.eu> wrote:
> Such bytes are rare and will have a large huffman encoding in H2. Martin's
> suggestion of '><' could be more efficient, though I haven't checked.

I tend to think that we should not let hpack drive this.  We should
maybe avoid Huffman encoding and then throw octets into the value
field.  Starting with a > or : or other octet is still probably useful
and might even be necessary.  In HTTP/1.1 we can use base64(url) as a
reasonable space/speed trade-off, again with the same demarc octet.
But we'd be defining a binary encoding.

Binary avoids the nastiness with character encoding (just use UTF-8),
makes numbers and dates much more numbery, and lets us tailor the
other types to our needs.

I think that PHK is perfectly right in recognizing that we don't have
complex needs.  I actually think that this is good.  Limitations are
empowering.

I said this privately to someone at the workshop, but my realization
was that we currently have schema-aware parsing with extremely limited
points of extension.  A revised system that supports that doesn't need
to be very complex.  Even a single level map of string key to
(optional) string value is more extensibility than we can sensibly
defend.