Live data from Hacker News

Parsing URLs in Python

tkte.ch

11–20 of 99 posts

Re: Parsing URLs in Python

#11

The Ada programming language is cursed with overlapping acronyms. GPS, ADA, SPARK, AWS. Seems it just got a little bit worse.

> Ada is a WHATWG-compliant and fast URL parser written in modern C++

Why would you do that, Daniel?

Re: Parsing URLs in Python

#12

Hard to imagine the tradeoff of using a third party binary library developed this year vs just using urllib.parse being worth it. Is this solving a real problem?

urlib.parse is a pain. We really need something more like pathlib.Path.

That used to be werkzeug.urls, kinda (it certainly had a more convenient API than urllib.parse), but it was killed in Werkzeug 3.

Re: Parsing URLs in Python

#14

The Ada programming language is cursed with overlapping acronyms. GPS, ADA, SPARK, AWS. Seems it just got a little bit worse.

It is mindboggling to me how often developers create project names without even trying to search for precedent names in their own domain/industry . Calling this Ada is just ridiculous.

Ada needs to fight back. Java templating library! Python dependency resolver! Zag image manipulation library! SQL event logging persistence framework!

I can’t believe Amazon wasn’t violating some anti-competition rule by using “AWS” for “Amazon Web Services” when it already meant “Ada Web Server.”

Wow when I search for “Ada GPS” I get global position system support libraries before GNAT Programming Studio.

Re: Parsing URLs in Python

#15

Earlier quoted context omitted.

urlib.parse is a pain. We really need something more like pathlib.Path.

That used to be werkzeug.urls, kinda (it certainly had a more convenient API than urllib.parse), but it was killed in Werkzeug 3.

I remember and miss that. But I’m not going to install werkzeug just for the url parsing.

Re: Parsing URLs in Python

#16

Hard to imagine the tradeoff of using a third party binary library developed this year vs just using urllib.parse being worth it. Is this solving a real problem?

According to itself, it's solving the issue of parsing differentials vulnerabilities: urllib.parse is ad-hoc and pretty crummy, and the headliner function "urlparse" is literally the one you should not use under any circumstance: it follows RFC 1808 (maybe, anyway) which was deprecated by RFC 2396 25 years ago.

The odds that any other parser uses the same broken semantics are basically nil.

Re: Parsing URLs in Python

#17
Writing a new parser in C++ is a mistake IMO. At the very least, you need to write a fuzzer. At best, you should be using one of the many memory safe languages available to you.

I retract my criticism if this project is just for fun.

Edit: downvoters, do you disagree?

Edit2: OK, I may have judged a bit prematurely. Ada itself has fuzzers and tests. They're just not exported to the can_ada project.

Post reply on HN