Re: [whatwg] New URL Standard from Anne van Kesteren on 2012-09-24 (public-whatwg-archive@w3.org from September 2012)

David Sheets <kosmo.zb@gmail.com> Thu, 25 October 2012 03:37 UTC

Return-Path: <kosmo.zb@gmail.com>
X-Original-To: ietf@ietfa.amsl.com
Delivered-To: ietf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 955DD1F0C4A for <ietf@ietfa.amsl.com>; Wed, 24 Oct 2012 20:37:31 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.599
X-Spam-Level:
X-Spam-Status: No, score=-3.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WZh0vxOsqQdM for <ietf@ietfa.amsl.com>; Wed, 24 Oct 2012 20:37:30 -0700 (PDT)
Received: from mail-oa0-f44.google.com (mail-oa0-f44.google.com [209.85.219.44]) by ietfa.amsl.com (Postfix) with ESMTP id 061C91F0C6A for <ietf@ietf.org>; Wed, 24 Oct 2012 20:37:29 -0700 (PDT)
Received: by mail-oa0-f44.google.com with SMTP id n5so1311823oag.31 for <ietf@ietf.org>; Wed, 24 Oct 2012 20:37:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=SPPy4ES9LUn+157VP35193JShq2zjpp/VAg4SsCHij8=; b=EdMLUItd1gom/yBsTUwyic8tzHXG44iZVeMUmwDBr0bflku7ikmW7Pmqly5ujs+Xes eCBu4DxfHfGaVpjIkMdTO2Azj//Ez9TAXwCglD4vHTUJjEMkAzCcNk+t5HkU9CzUkjBT x+6WFl+Z7SJkfE5sB4L0NpoES3Ykq4DgP6O5cGiRO/FMQqwXyeXp6aXFVcLK+GPoxoWC YzZBZMthTruySfZZS2Q1q0DLWwzLdIm9FIkti6R1jq3250ypHXtPnNizRLpLr3Zi1JtF lb9J5pYWcZgkcAWlHAXdHkZZvxRivxxrlC8V+h5JtgirnNKV1Jr+xKIVzyuX0iGMXQ0J RkoA==
MIME-Version: 1.0
Received: by 10.60.14.165 with SMTP id q5mr16159174oec.28.1351136248850; Wed, 24 Oct 2012 20:37:28 -0700 (PDT)
Received: by 10.76.13.132 with HTTP; Wed, 24 Oct 2012 20:37:28 -0700 (PDT)
In-Reply-To: <Pine.LNX.4.64.1210240451150.2471@ps20323.dreamhostps.com>
References: <50604C1A.7090901@gmx.de> <5060A964.5060001@stpeter.im> <Pine.LNX.4.64.1210172354500.2478@ps20323.dreamhostps.com> <507F5A7E.6040206@arcanedomain.com> <50856E3C.103@gmail.com> <Pine.LNX.4.64.1210221753010.2471@ps20323.dreamhostps.com> <0DBC8A11-319C-4120-975E-7E40FD5818BF@gbiv.com> <Pine.LNX.4.64.1210222137530.2471@ps20323.dreamhostps.com> <CA+9kkMDpEZCvcG1DJd=O1qPNV+=+GTBeN+CGndUe51Xym_A9sg@mail.gmail.com> <Pine.LNX.4.64.1210232115210.2471@ps20323.dreamhostps.com> <15E1D98B-8883-4936-81A9-174E1323683C@nordsc.com> <CAGKvQ5ZV6_GMVgjEezhR-oKqSikxR7GYgacMitbfczmNh725mw@mail.gmail.com> <Pine.LNX.4.64.1210232348110.2471@ps20323.dreamhostps.com> <CAAWM5Tz3NdprjqwgyoVoV9qUuiwXb2gTQ49u4a4ePGfjyusDkw@mail.gmail.com> <Pine.LNX.4.64.1210240451150.2471@ps20323.dreamhostps.com>
Date: Wed, 24 Oct 2012 20:37:28 -0700
Message-ID: <CAAWM5TzjsxOWB4pL3XaWAa5zDdsZb=1-jOZ2JM9L9hbPtd7azA@mail.gmail.com>
Subject: Re: [whatwg] New URL Standard from Anne van Kesteren on 2012-09-24 (public-whatwg-archive@w3.org from September 2012)
From: David Sheets <kosmo.zb@gmail.com>
To: Ian Hickson <ian@hixie.ch>
Content-Type: text/plain; charset="ISO-8859-1"
X-Mailman-Approved-At: Wed, 24 Oct 2012 20:37:57 -0700
Cc: Ted Hardie <ted.ietf@gmail.com>, IETF Discussion <ietf@ietf.org>, Christophe Lauret <clauret@weborganic.com>, Jan Algermissen <jan.algermissen@nordsc.com>, URI <uri@w3.org>, Anne van Kesteren <annevk@annevk.nl>, "Manger, James H" <James.H.Manger@team.telstra.com>
X-BeenThere: ietf@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: IETF-Discussion <ietf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ietf>, <mailto:ietf-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/ietf>
List-Post: <mailto:ietf@ietf.org>
List-Help: <mailto:ietf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ietf>, <mailto:ietf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 25 Oct 2012 03:37:31 -0000

On Tue, Oct 23, 2012 at 10:05 PM, Ian Hickson <ian@hixie.ch> wrote:
> On Wed, 24 Oct 2012, Manger, James H wrote:
>>
>> Currently, I don't think url.spec.whatwg.org distinguishes between
>> strings that are valid URLs and strings that can be interpreted as URLs
>> by applying its standardised error handling. Consequently, error
>> handling cannot be at the option of the software developer as you cannot
>> tell which bits are error handling.
>
> Well first, the whole point of discussions like this is to work out what
> the specs _should_ say; if the specs were perfect then there wouldn't be
> any need for discussion.

Good! Let's have a discussion about what the spec should say.

> On Tue, 23 Oct 2012, David Sheets wrote:
>>
>> One algorithm? There seem to be several functions...
>>
>> - URI reference parsing (parse : scheme -> string -> raw uri_ref)
>> - URI reference normalization (normalize : raw uri_ref -> normal uri_ref)
>> - absolute URI predicate (absp : normal uri_ref -> absolute uri_ref option)
>> - URI resolution (resolve : absolute uri_ref -> _ uri_ref -> absolute uri_ref)
>
> I don't understand what your four algorithms are supposed to be.

Ian, these are common descriptors (and function signatures).

Here are (longer) prose descriptions for those unfamiliar with
standard functional notation:

*parse* is a function which takes the contextual scheme and a string
to be parsed and produces a structure of unnormalized reference
components.
*normalize* is a function which takes a structure of unnormalized
reference components and produces a structure of normalized reference
components (lower-casing scheme, lower-casing host for some schemes,
collapsing default ports, coercing invalid codepoints, etc).
*absp* is a function which takes a structure of normalized reference
components and potentially produces a structure of normalized
reference components which is guaranteed to be absolute (or nothing:
in JS, this roughly corresponds to nullable).
*resolve* is a function which takes a URI structure and a reference
component structure and produces a URI structure corresponding to the
reference resolution of the second argument against the first (base)
argument.

See my original message for how these compose into your one_algorithm.

> There's just one algorithm as far as I can tell -- it takes as input an
> arbitrary string and a base URL object, and returns a normalised absolute
> URL object, where a "URL object" is a conceptual construct consisting of
> the components scheme, userinfo, host, port, path, query, and
> fragment, which can be serialised together into a string form.

How is the arbitrary string deconstructed? How is the result
normalized? What constitutes an absolute reference? How does a
reference resolve against a base URI?

>> Anne's current draft increases the space of valid addresses.
>
> No, Anne hasn't finished defining conformance yet. (He just started
> today.)

This is a political dodge to delay the inevitable discussion of
address space expansion.

>From what I have read of WHATWG's intentions and discussed with you
and others, you are codifying current browser behavior for
'interoperability'. Current browsers happily consume and emit URIs
that are invalid per STD 66.

<http://url.spec.whatwg.org/#writing> presently says:
"A fragment is "#", followed by any URL unit that is not one of
U+0009, U+000A, and U+000D."
This is larger than STD 66's space of valid addresses.

>> > The de facto parsing rules are already complicated by de facto
>> > requirements for handling errors, so defining those doesn't increase
>> > complexity either (especially if such behaviour is left as optional,
>> > as discussed above.)
>>
>> *parse* is separate from *normalize* is separate from checking if a
>> reference is absolute (*absp*) is separate from *resolve*.
>
> No, it doesn't have to be. That's actually a more complicated way of
> looking at it than necessary, IMHO.

Why use several simple, flexible sharp tools when you could use a
single complicated, monolithic blunt tool?

Why do you insist on producing a single, brittle, opaque function when
you could produce several simply-defined functions that actually model
the data type transformations?

Vendors are, of course, always free to implement an optimized
composition for their specific use cases.

>> Why don't we have a discussion about the functions and types involved in
>> URI processing?
>>
>> Why don't we discuss expanding allowable alphabets and production rules?
>
> Personally I think this kind of open-ended approach is not a good way to
> write specs.

The specs already exist and use these formalisms successfully. Why do
you think discussions about the model of the problem-space are
'open-ended'? Why are you trying to stop a potentially productive
discussion?

> Better is to put forward concrete use cases, technical data,
> etc, and let the spec editor take all that into account and turn it into a
> standard.

Is <https://github.com/dsheets/ocaml-uri/blob/master/lib/uri.ml#L108>
correct or should safe_chars_for_fragment include '#'?

Whatever 'standard' you produce will require me to exert significant
effort on your One Giant Algorithm to factor it into its proper
components and reconcile it with competing standards for my users. I
have applications that use each of the above functions separately.

> Arguing about what precise alphabets are allowed and whether to
> spec something using prose or production rules is just bikeshedding.

I can only conclude that you understand neither the value of precision
nor the meaning of "bikeshedding".

You are not constructing anything remotely comparable to a nuclear reactor.

I am expressing a genuine desire to discuss the actual technical
content of the relevant specifications in the most precise and concise
way possible.

I am losing confidence in your technical leadership.

Sincerely,

David Sheets