webspecs / url

The URL specification
https://specs.webplatform.org/url/webspecs/develop/
Other
21 stars 9 forks source link

Parser seems to return strings rather than data types #14

Closed annevk closed 9 years ago

annevk commented 9 years ago

I don't understand why the IPv4 bit of the parser for instance returns a string rather than the underlying representation. The same goes for many other parts of the parser.

That does not seem useful going forward if we ever want to introduce APIs that return things closer to the metal.

rubys commented 9 years ago

If we need in the future to add such an API, we can address it them. Meanwhile:

http://c2.com/cgi/wiki?DoTheSimplestThingThatCouldPossiblyWork http://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it

annevk commented 9 years ago

You can't both define host as several different things while it's actually always a string. And I'm pretty sure we want to be able to distinguish between it being different things. And we want to operate on components of a domain.

rubys commented 9 years ago

Yet we can for URL? https://www.w3.org/Bugs/Public/show_bug.cgi?id=26405#c1 :-)

If/when there is demonstrable implementor interest in operating on components of a domain, it can be added at that time.

annevk commented 9 years ago

There is, look at e.g. the grammar for CSP, wildcard certificates, cookies, definition of public suffix... We need to provide the primitives so they can all be written on top.

annevk commented 9 years ago

(Note that having one term mean different things depending on context is not quite the same. And I think that's probably no longer a good idea, given that people keep seeing that as a problem.)