top | item 34183020

An M1 for Curl

234 points| HieronymusBosch | 3 years ago |daniel.haxx.se | reply

175 comments

order
[+] mittermayr|3 years ago|reply
I am always amazed at the generosity of some people who use free/open-source software. It definitely makes me want to try and become more supportive to such efforts myself.

I make a (closed-source but completely free/ad-free) minimal macOS app for Hue, and every other day (sometimes a week goes by) I get a lovely price-of-a-coffee-sized donation from someone in the community. And when I ask for their name to include them in a credits or supporters panel, most don't even want me to mention it or credit them.

One time, I struggled to replicate an issue for which I didn't have the necessary hardware (multiple Hue bridges), and the bug reporter simply offered to buy and send me "a bunch of bridges and lights" to make debugging easier. I couldn't accept it, but it's gestures like that, combined with positive feedback from people wanting the project to keep going and succeed, that are such a tremendous motivational driver for working on "free stuff". I had totally underestimated that (coming from the SaaS side).

[+] comprev|3 years ago|reply
Whenever I donate something it’s always on condition of anonymity.

Recently I donated my old top-spec race MTB to a bike club, under the condition it was to be gifted to one of the Ukrainian’s who’ve been displaced and now live in our community. Nobody knew I had the bike. Within a few days I got a message back saying there was a teenager that loved racing bikes back in his home country, and can now look forward to the 2023 season with additional financial/logistical support from the club.

I’ll probably bump into them on the local trails and seeing their beaming (and muddy!) smile is worth a thousand times more than publicly being connected to the donation.

[+] roel_v|3 years ago|reply
"I couldn't accept it"

Why not?

[+] gog|3 years ago|reply
What is the name of the app?
[+] sleepychu|3 years ago|reply
Can anyone think of the reason Apple wouldn't provide hardware support to curl and similar projects?

To my mind "this dev tool doesn't work, only on Apple, only on Apple's flagship chips" is the opposite of what they'd like to see happen.

[+] alkonaut|3 years ago|reply
Any of us working in an enterprise can probably relate to this similar thing: If I want to purchase a $500 piece of software, that’s a five minute conversation with my manager.

If I wanted to donate $50 to a single person who has developed a critical bit of open source we as a company gas relied on for ten years, it would be a major hassle.

[+] belfalas|3 years ago|reply
For 20 years they’ve gotten it for free. Why start paying now? Apple is not a friend to the little guy, quite the opposite.

Remember, Steve Jobs was good friends with Larry Ellison who famously said that open source is there to be exploited. These guys all think the same way.

[+] niklasmerz|3 years ago|reply
Same goes for Apache Cordova a framework for building mobile apps for Android and iOS. Apple knows a big chunk of apps in the App Store are using it.

You can only use it for iOS apps if you have Apple hardware. I am one of the maintainers and thankfully I got a Mac Mini donated as well when I lost my company Mac.

[+] frou_dh|3 years ago|reply
IIRC, at least around the time Apple Silicon was introduced, they were running some kind of taskforce to make code contributions to key open source projects to ensure they were compatible.
[+] etchalon|3 years ago|reply
There's no good reason beyond, "Apple doesn't do that, and never has."
[+] Teever|3 years ago|reply
Bexause they don't want to. its that simple.

Any time you see a behemoth like Apple not doing something it's because they don't want to.

They don't consider whatever gains they get from it to be worth the time and money.

[+] gregoriol|3 years ago|reply
Apple would more likely develop their own similar code instead.
[+] thisarticle|3 years ago|reply
The logistics I imagine of doing so for projects would be immense. For ten projects, maybe it wouldn’t be bad, but which ten? Etc.
[+] amelius|3 years ago|reply
Well they get great publicity from all the "Now available on M1 too!" posts on HN.
[+] varispeed|3 years ago|reply
They probably don't want to set up a precedent and that would be against the true spirit of open source - to get people writing software for free, so big corporations can save on R&D and employment costs, while making a ton of money.
[+] fweimer|3 years ago|reply
Apple has proprietary, in-house solutions for these tasks. If I were an employee working on one of those, I wouldn't like if a different part of the company provided support to or funding for an alternative to the thing I'm working on.
[+] ApolloVonZ|3 years ago|reply
I’d like to post the Apple GitHub account where you can find quite a few repositories Apple is developing open source for not only Apple platforms. They even just announced that the new Swift native Foundation framework will be completely open source. I think that’s pretty significant.

https://github.com/apple

[+] icco|3 years ago|reply
While this is great, there are so many more FOSS projects that OSX relies on that Apple doesn't support in any way.
[+] Rebelgecko|3 years ago|reply
I'm surprised the performance stats weren't more dramatic. Is the compilation not taking advantage of multiple cores? Or for this task is the m1 really do comparable to an Intel 3rd gen cpu?
[+] fabioborellini|3 years ago|reply
M1 is particularly spectacular when compared to other chips with similar thermal characteristics. i7-3770K has TDP of 77 W, without a GPU, so it has 7-8 times the power budget of M1 for the CPU.

In raw performance, M1 cannot match workstation-class CPUs. Since Apple was almost exclusively offering only ultra-mobile Intel chips with horribly dated GPUs, M1 was a giant leap in their offering, but in the desktop PC market there are more powerful chips available. And even some old ones can perform quite well.

[+] dijit|3 years ago|reply
Honestly those numbers are miserable and not in-line with what I have experienced with M1 (or M2).

The numbers make me think it's using the 'efficiency' cores, or might indicate a lot of memory pressure issues (which seems unlikely at 16GiB)

There's a better write-up about compilation performance here: https://build2.org/blog/apple-m1-compilation.xhtml

For macOS there is a `taskpolicy` command to set the usage of efficiency and high performance cores. I'd expect that it's using high performance cores by default but you can force it by running `taskpolicy -c utility <program>`.

You can also force it to be run on efficiency cores by running `taskpolicy -c background <program>`

[+] caseysoftware|3 years ago|reply
If you're looking to support open source projects, Open Collective has a workable model: https://opencollective.com/curl

If you want your employer to contribute, check your expense policy. Most companies have a threshold below which you don't need a receipt or even explicit approval. At my last company, that was $50 so I convinced Daniel (of curl) to add a $25/month level specifically to take advantage of it. :)

[+] zcbenz|3 years ago|reply
I have no relationship with Apple, but from my experience, the usual way big corp contributes to open source is to have their engineers sending patches, instead of sponsoring money/hardware directly.

For example Apple sent patches to some open source projects to add support for Apple Silicon: https://twitter.com/markvillacampa/status/127520044676491264...

[+] Jnr|3 years ago|reply
That is great, but what if the maintainer wants to test those patches before merging? :)
[+] binarymax|3 years ago|reply
“I expected the differences to be bigger” is some serious shade!
[+] lukeh|3 years ago|reply
Apple gave me a G4 once when I was contributing to Darwin but, that was a long time ago and the culture may have changed. However I suspect if you had an existing relationship with an engineer there, they'd throw some surplus hardware your way.
[+] burmanm|3 years ago|reply
The most amazing thing in that article is: "The source code is stored on an OCZ-VERTEX4 SSD on the Intel,"

That must be the only surviving OCZ Vertex4 in existence.

[+] zimbatm|3 years ago|reply
Are there any places where Apple contributes back to the open source ecosystem?

Their engineers are prohibited from contributing back to the ecosystem so it's not possible to engage with them in a reasonable manner.

They don't acknowledge popular open source projects. Is it too much to ask to even have a single engineer talk to popular projects like Homebrew?

They make us pay to build on their platforms. CI is more expensive, harder to get access to. Emulation is prohibited.

Everywhere I look, it looks like they are a negative force. Sucking out good will and not giving anything back.

[+] thamer|3 years ago|reply
> Their engineers are prohibited from contributing back to the ecosystem

Things have changed and this is no longer true. A significant number of projects receive frequent contributions from Apple engineers. The majority of active committers on Apache Cassandra are at Apple for example, contributing major features such as a new transactional system[1].

My team actively contributes to Spinnaker, and we're currently hiring someone with a focus on open-source contributions, quoting the second "key qualification" in the job listing[2]: "Interest in developing with open source software and contributing back to the community".

[1] https://cwiki.apache.org/confluence/display/CASSANDRA/CEP-15...

[2] https://jobs.apple.com/en-us/details/200361051/apple-cloud-p...

[+] dagmx|3 years ago|reply
Apple contribute a lot to open source, and I think your last statement of them being a negative force is kind of ridiculous given some of the work that heavily depended on their engineering.

Firstly, they have a site that lists some of their work https://opensource.apple.com/ but going further, projects like Chrome wouldn’t exist without Safari having forked KHTML and then massively worked on WebKit. Clang + LLVM would likely not exist in their current form either (clang started at Apple, llvm was earlier but a lot of early push came from them). Which in turn would have changed the landscape today regarding other languages like Rust.

Those are just two of the major ones. There are other major ones like OpenCL that come to mind too, let alone other projects that get code contributions (OBS, Blender, etc…)

They probably don’t contribute as much as they could , in an ideal world, but the foundation of your comment is untrue.

[+] zeckalpha|3 years ago|reply
LLVM and WebKit are two key examples
[+] bpicolo|3 years ago|reply
Foundationdb is a pretty big thing to open source
[+] adenozine|3 years ago|reply
They declined to hire the homebrew guy because he sucked at whiteboarding. Apple is terrible for FOSS. I like their phones but I’d never write for them or use/support their machines.

Edit: I was wrong, twas the Goog, in fact.

[+] magicloop|3 years ago|reply
Since the author mentions there are many users of curl on Apple platforms, there should be a pool of engineers from which a volunteer could be found to help out.

The author didn't mention reaching out to Apple for help? My opinion is if Apple documentation call out the use of curl as part of a workflow or enabling step, or actually as part of a product, then there is a moral duty to help out (not a legal or license duty).

I would prefer to see the big tech companies contribute to a foundation who could redistribute funds to key open source groups. A credit for a cloud instance of the machine would be sufficient in most cases. It would also remove undue influence of one vendor over another. Maybe such a thing exists, and I would welcome if someone pointed it out.

[+] traceroute66|3 years ago|reply
> then there is a moral duty to help out (not a legal or license duty).

May I invite you to descend off that hobby horse for a moment ?

Let us perhaps replace the word "Apple" with a variable parameter, say, $VERY_LARGE_CORPORATION

Lets say you turn up at said $VERY_LARGE_CORPORATION and start talking to them about something wishy-washy, intangible and wholly subjective such as a "moral duty".

You will be laughed out of the room.

Once a company grows to a size where employees are measured in the tens or hundreds of thousands then it is simply impossible to get involved in edge-cases and subjective matters. Everything has to be defined and measurable because otherwise the whole caboodle descends into utter chaos very quickly.

[+] fnord123|3 years ago|reply
> I would prefer to see the big tech companies contribute to a foundation who could redistribute funds to key open source groups.

You mean like the Linux Foundation? Or the Cloud Native Computing Foundation? Or the Rust Foundation? Or the Python Software Foundation? Or the Free Software Foundation? Or the Software Freedom Conservancy? Or the Mozilla Corporation?

[+] mik1998|3 years ago|reply
Why would Apple do anything? They're getting it for free while contributing nothing. It's what you should expect when developing permissively licensed software.
[+] IshKebab|3 years ago|reply
> Apple has shipped and used curl in their products for twenty years but they never assist, help or otherwise contribute to the development. They also don’t sponsor us in any way, like with hardware.

Do they have an obligation to? Even a moral one? Honestly I don't think (I hope!) Apple actually uses curl in their products (probably a good thing). It's just provided as a convenience to developers who might be used to it.

I got curious about Apple's use of Curl and Googled it. One of the top hits was another blog post complaining about Apple not donating Macs:

https://daniel.haxx.se/blog/2021/09/25/curls-first-twenty-ye...

I think you could replace 99% of the uses of Curl (download one file via HTTPS) with like 100 lines of Python or Rust or Go. It's not critical infrastructure in the same way that OpenSSL or LLVM or WebKit are.

[+] mastax|3 years ago|reply
I don't think they have a moral obligation to, necessarily. But in exchange for $1000 of hardware (at retail price, mind) they would easily get >>$1000 of value for them and their customers.

It doesn't make sense not to do it, if the corporation is a single rational hive mind. Of course, it isn't. A corporation is a collection of individuals, each operating with different goals and limited information.

[+] cokeandpepsi|3 years ago|reply
> It's not critical infrastructure in the same way that OpenSSL or LLVM or WebKit are.

libcurl is for sure

[+] cp9|3 years ago|reply
I’d suggest learning what libcurl is used for before throwing it out with the bath water ¯\_(ツ)_/¯
[+] redlofa|3 years ago|reply
So the Curl Project in GH has 9751 issues closed. You are talking about 100 lines of Python or Rust/Go. That claim is kind of funny given the amount of edge cases HTTP requests come across and Curl having solved them. As a web dev we use frequently Curl for Downloading file, post request, follow redirects, check HTTP status. There are countless other usage of Curl apart from File downloading as you are repeating.