Live data from Hacker News

“I Could Rewrite Curl”

daniel.haxx.se

41–50 of 193 posts

Re: “I Could Rewrite Curl”

#42
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…

If any of those people had written such a client (in Rust even!) could you link me to their project?

Re: “I Could Rewrite Curl”

#43
post #15

What's frustrating is people who think that they can radically simplify something without knowing anything about it. The same people think they can implement a text editor in 1000 lines of code because that's how the first text editors were made. Why can't we go back to those simple days? We can't because modern software handles cases that those didn't. For example, rendering and editing text seems straightforward un…

And in fact even the "simplest" editors seemed to take quite some time even for our heroes. Ken Thompson has stated [1] that he devoted a week out of a month for what I understand was the first version of ed(1):

[...] [my wife] was gone a month to California and I allocated a week each to the shell, to the operating system, the shell, the editor, and the assembler, to reproduce itself [...]

[1] https://www.princeton.edu/~hos/mike/transcripts/thompson.htm

Re: “I Could Rewrite Curl”

#44
post #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,…

> SMB

Woah. This is genuienly impressive.

Re: “I Could Rewrite Curl”

#45

Just a little tangent but I think everyone should know cURL… not postman, not httpie or any other more “friendly” tool. cURL is the standard, pre-installed, do-everything, scriptable tool to interact with web APIs. I could say mostly the same stuff about knowing Bash. It separates the barely effective from hyper-effective individuals on simple day to day (programming) tasks.

I am always highly annoyed when someone has documentation for their web API and all that they provide is some postman collection of crap (or a crappy code example in an arbitrary language) and some vague abstract description of their API. Then I'll have to spend X amount of time on reverse engineering it to curl so I can see what's actually going on. Often I'll discover that they're doing really weird stuff (double base64 encoding for example) and that I'm the first to notice that it is weird. When I tell them I use curl they think I'm some hacker using some obscure tool.

Too many people in our field just take the first thing that works and they won't bother to actually look at it.

Re: “I Could Rewrite Curl”

#46
post #15

What's frustrating is people who think that they can radically simplify something without knowing anything about it. The same people think they can implement a text editor in 1000 lines of code because that's how the first text editors were made. Why can't we go back to those simple days? We can't because modern software handles cases that those didn't. For example, rendering and editing text seems straightforward un…

And in fact even the "simplest" editors seemed to take quite some time even for our heroes. Ken Thompson has stated [1] that he devoted a week out of a month for what I understand was the first version of ed(1): [...] [my wife] was gone a month to California and I allocated a week each to the shell, to the operating system, the shell, the editor, and the assembler, to reproduce itself [...] [1] https://www.princeton.…

An editor seems insanely simple until you realize that computers really don't like "inserting" data into existing data in memory, and then you're staring down the barrel of continuous memcpys.

Re: “I Could Rewrite Curl”

#47
Whenever I see someone say something like "I could rewrite X in a weekend" I think, "well then fucking do it, if it's that easy."

If you think you can build a curl replacement in 100 lines of code, do it, and open source it so a other randos on the Internet can complain about it.

Re: “I Could Rewrite Curl”

#48
post #5

I can write cURL in 1 line of bash: alias mycurl='curl' /s

I think there's more truth to this comment than your presentation suggests.

I bet at least a subset of people who think they could reimplement curl easily, think of curl as a CLI tool to make HTTP requests. It's just a little bit of python/requests or node/fetch code to cover some basics for that. I think these people simply aren't aware that their programming language's built-in libraries often call in to libcurl for the dirty work.

Re: “I Could Rewrite Curl”

#49

The problem isn't CURL, but HTTP. It's actually suprisingly complex and really needs to die. That'll never happen though.

Plenty of applications use TCP and UDP, or even custom protocols on top of raw IP.

Not everything needs to come through the browser.

Re: “I Could Rewrite Curl”

#50
post #15

What's frustrating is people who think that they can radically simplify something without knowing anything about it. The same people think they can implement a text editor in 1000 lines of code because that's how the first text editors were made. Why can't we go back to those simple days? We can't because modern software handles cases that those didn't. For example, rendering and editing text seems straightforward un…

Second link is a 404 fyi

Fixed, thanks for pointing it out.
Post reply on HN