Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Parsing urls is not difficult at all

I’d like to have 100 developers each write a url parser, and see how many bugs per implementation we can find. I’d guess an average in the double-digits



I did write a URL parser (including converting relative URLs into absolute) in C (I also wrote a simple HTTP client, and other protocols). However, it is only intended for use with a limited set of URI schemes (including "hashed" and "jar", both of which are unusual in the way they are handled).

(See the function called "scogem_parse_url" in the https://raw.githubusercontent.com/zzo38/scorpion/trunk/scoge... file.)

Now, we can find bug in that one, and then if other people mention theirs too, and find bug in other one, then we can see how accurate your guess is.

However, there are other considerations. For one thing, WHATWG is not the only specification of the working of URLs, so not everyone will comply anyways. And, some features might be necessary or not necessary in specific applications.


Maybe this is a case of "I could write curl in a weekend", proceeds to use libcurl one way or the other.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: