Hacker News new | past | comments | ask | show | jobs | submit login

Obviously everyone could rewrite curl*, in 2021, or so they think.

Here's the magic in that trick: we have, collectively, amassed a heap of knowledge on HTTP and its behavior in the wild; this was made possible by curl, in the first place. Once this is handwaved away, of course it's easy to do. "Look at me, [standing on the shoulders of giants,] I have a really great view from up here!"

(*small print: and this is speaking about the happy path, where client, its stack, network, server stack, and server all align perfectly; this happens pretty much never)




I wonder what percentage of attempts to rewrite curl in modern languages end up eventually just calling code from libcurl if you trace down through their standard libraries far enough?


What standard library uses curl for HTTP ? AFAIK, none of Go, Python or Node does.


Many of the commonly used Ruby HTTP gems use libcurl under the hood.


I'm not that familiar, but I believe php does


"PHP," he said with a shudder.


I wonder how many attempts to rewrite curl would need to use curl to understand how the protocol works?


This is quite acceptable, IMNSHO. If you're reinventing a wheel, of course you need to know why your predecessors have not used the Obvious Simple Shortcut That Intuitively Makes Sense. Was it not available back when this was written? Was it to keep compatibility with Windows XP? Or perhaps your idea really did not occur to the developers.

Most time - when reimplementing stuff - is not spent coding, or even debugging, but on research.




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

Search: