Re: [whatwg/url] Provide a succinct grammar for valid URL strings (#479)

> 2. Second, I believe that you already basically have not one, but _two_ alternate semi-normative specifications anyway: the section on writing URLs, which specifies a sort of a grammar on how to write them out

To be clear, there’s nothing semi-normative about that https://url.spec.whatwg.org/#url-writing section. It’s normative.

> and the test suite.

And to be clear about that: The test suite is not normative.

> I don't believe that anyone can state with certainty that the section on writing URLs actually matches the parser

The section on writing URLs doesn’t claim it matches the parser. Specifically: There are known URL cases that the writing-URLs section defines as non-conforming — as far as documents/authors being prohibited for using them— but which have normative requirements that parsers must follow if documents/authors use them anyway.

> and I think [this comment](https://github.com/whatwg/url/issues/418#issuecomment-429746822) _by one of the major contributors to the spec_ goes to show how the test suite is treated basically as normatively as the spec, if not more.

While some people may treat the test suite as authoritative for certain purposes, it’s not normative. In the URL spec and other WHATWG specs, the term *normative* is term of art used very consistently with a very specific unambiguous meaning: it applies to the language in the spec that states requirements (e.g., using RFC  2119 _must_, _must not_, _should_, _should not_ language).

The test suite doesn’t state requirements; instead it tests the normative requirements in the spec. And if the test suite were to test something which the spec doesn’t explicitly require, then the test suite would be out of conformance with the spec.

> - Most relevantly to the original topic here, it is nearly impossible for a human to reason about whether or not a URL is valid without manually executing the algorithm.

The algorithm doesn’t define whether a URL is valid or not; instead the algorithm defines how a URL must be processed, whether or not the https://url.spec.whatwg.org/#url-writing section defines that URL as valid/conforming.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/issues/479#issuecomment-714231775

Received on Thursday, 22 October 2020 05:12:30 UTC