Live data from Hacker News

“I Could Rewrite Curl”

daniel.haxx.se

21–30 of 193 posts

Re: “I Could Rewrite Curl”

#21
post #16

Every piece of software that people actually use will face criticism. But as quite honestly for some one with the clout of Mr Stenberg to out some poor Joe Codes just because they dared to have an opinion is just as pathetic if not more. Writing an HTTP 1 client in a weekend is doable and Rust is probably a better language today than C is (with some caveats obviously). Is having that opinion enough to to be publicly…

Is he not similarly entitled to "dare to have an opinion"?

What is the level of clout at which point you should be forbidden from commenting on criticism people direct at you on public forums?

Re: “I Could Rewrite Curl”

#22

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 sp…

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?

Re: “I Could Rewrite Curl”

#24
post #11

Earlier quoted context omitted.

And the fact that it would be really easy to rewrite a usable subset of curl if you use your language's `import curl` which has behind the scenes had as much development effort as curl itself.

curl is mostly libcurl, `curl` the executable command is just one of the ways to interface with it. (Unless you're saying "let's pretend to reimplement curl by wrapping around curl behind the scenes," which is delightfully tautological.)

I think they meant their languages HTTP client, not literally the libcurl bindings

Re: “I Could Rewrite Curl”

#25
Excluding the bragging, I don't think this part of the first comment is incorrect: "You can implement a 90% usecase HTTP client in < 100 lines without golfing." We use the general purpose curl machine for convenience, but a minimal version would suffice for majority of cases. (Just an observation, I'm not suggesting we do that)

Re: “I Could Rewrite Curl”

#26
post #3

I'd love to see more people sponsor Daniel's work. (I do, because every job I've had in the last two decades has needed it.) https://github.com/sponsors/bagder

It would be interesting if there were a site where people could sponsor bounty payments for security vulnerabilities in open source software.

On curl: https://hackerone.com/curl?type=team says "All rewards in our program are graciously donated by our sponsors." with a link to https://curl.se/sponsors.html, and that probably works well for a large project like curl.

Re: “I Could Rewrite Curl”

#27
"I could write the subset of curl that I minimally understand and build something much simpler in X amount of time".

I sometimes think this but then I remember all the edge-cases in even the most basic real world code.

Re: “I Could Rewrite Curl”

#30
Let's be honest here. Curl to 98% of people is http/1 requests with some post params and maybe json body, with some custom headers. Most language standard libs (which might be using libcurl) can facilitate writing that relatively quickly. And probably with a more 'modern' CLI.

Curl though, is a very wide breadth project. It currently supports the following protocols: DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP.

Each one of those is a massive undertaking of protocol/spec management, edge case handling, cross compatibility, hacks, and much much more to make them work. Then to put a stable C api on top of it all to be a cross language toolkit is a MASSIVE undertaking.

But, again, the "idiots" who posted those comments, aren't talking about any of this. Perhaps they shouldn't care to. Most folks I know don't even know about the other protocols curl supports and have only interfaced with curl through its http. Frankly there are nicer http cli's out there with less code that _can_ be written in a weekend (assuming they piggy back on a http lib).

What Daniel Stenberg achieved is giving the world a fantastic, reliable, cross protocol, cross platform and cross language network library that can be used as the foundation for many projects. I'm sure few of those cited would claim they could do that.

Post reply on HN