Re: [whatwg/url] It's not immediately clear that "URL syntax" and "URL parser" conflict (#118)

I just read some great walls of text this issue generated(or provoked), and I'd like to state my humble opinion as a web developer.

Making the parser and the syntax conflict seems weird (if not wrong). 

If you define a syntax you are defining some type of a formal language in Chomsky hierarchy. From the grammar of that language, there is a way to generate a corresponding type of automaton correctly, and there are plenty of ways to convert this automaton into some optimized parser program. And conversely, there is a way to convert a parser into a corresponding grammar.

By defining a parser and a syntax which conflict, you are effectively defining two distinct languages and two distinct coresponding programs. And there is talk of convergence... You cannot create an atmosphere suitable for convergence when your two definitions do not converge.

If you are defining two distinct languages(sets of valid strings) and if one of these sets is the subset of the other one, guess which one every parser will choose.

If you want to loosen the syntax, loosen the syntax and make it match the parser. If you want to give a correct and strict parser pseudocode implementation as an example for implementers, do that and make it match the syntax. But making them conflict goes against everything I know about computer science, programming, design. And prescribing half valid(parsable but invalid, parsed with a console log) URLs just makes them practically valid, and fully valid over time. And after this transition happens anyone reading the standard will see it as a needlessly complicated document directly defining some obsolete syntax and indirectly defining the currently accepted syntax through a parser definition. 

Keep it simple. Prescribe or describe, don't do both. If you absolutely have to do both, at least don't do it in a single document. Separate them as clearly as you can. Don't confuse people, don't confuse yourselves.

-- 
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/118#issuecomment-276339258

Received on Tuesday, 31 January 2017 11:26:07 UTC