Google to reimplement curl in libcrurl

Not the entire thing, just “a subset”. It’s not stated very clearly exactly what that subset is but the easy interface is mentioned in the Chrome bug about this project.

What?

The Chromium bug states that they will create a library of their own (named libcrurl) that will offer (parts of) the libcurl API and be implemented using Cronet.

Cronet is the networking stack of Chromium put into a library for use on mobile. The same networking stack that is used in the Chrome browser.

There’s also a mentioned possibility that “if this works”, they might also create “crurl” tool which is then their own version of the curl tool but using their own library. In itself is a pretty strong indication that their API will not be fully compatible, as if it was they could just use the existing curl tool…

Why?

“Implementing libcurl using Cronet would allow developers to take advantage of the utility of the Chrome Network Stack, without having to learn a new interface and its corresponding workflow. This would ideally increase ease of accessibility of Cronet, and overall improve adoption of Cronet by first-party or third-party applications.”

Logically, I suppose they then also hope that 3rd party applications can switch to this library (without having to change to another API or adapt much) and gain something and that new applications can use this library without having to learn a new API. Stick to the old established libcurl API.

How?

By throwing a lot of man power on it. As the primary author and developer of the libcurl API and the libcurl code, I assume that Cronet works quite differently than libcurl so there’s going to be quite a lot of wrestling of data and code flow to make this API work on that code.

The libcurl API is also very versatile and is an API that has developed over a period of almost 20 years so there’s a lot of functionality, a lot of options and a lot of subtle behavior that may or may not be easy or straight forward to mimic.

The initial commit imported the headers and examples from the curl 7.65.1 release.

Will it work?

Getting basic functionality for a small set of use cases should be simple and straight forward. But even if they limit the subset to number of functions and libcurl options, making them work exactly as we have them documented will be hard and time consuming.

I don’t think applications will be able to arbitrarily use either library for a very long time, if ever. libcurl has 80 public functions and curl_easy_setopt alone takes 268 different options!

Given enough time and effort they can certainly make this work to some degree.

Releases?

There’s no word on API/ABI stability or how they intend to ship or version their library. It is all very early still. I suppose we will learn more details as and if this progresses.

Flattered?

I think this move underscores that libcurl has succeeded in becoming an almost defacto standard for network transfers.

A Google office building in New York.

There’s this saying about imitation and flattery but getting competition from a giant like Google is a little intimidating. If they just put two paid engineers on their project they already have more dedicated man power than the original libcurl project does…

How will it affect curl?

First off: this doesn’t seem to actually exist for real yet so it is still very early.

Ideally the team working on this from Google’s end finds and fixes issues in our code and API so curl improves. Ideally this move makes more users aware of libcurl and its API and we make it even easier for users and applications in the world to do safe and solid Internet transfers. If the engineers are magically good, they offer a library that can do things better than libcurl can, using the same API so application authors can just pick the library they find work the best. Let the best library win!

Unfortunately I think introducing half-baked implementations of the API will cause users grief since it will be hard for users to understand what API it is and how they differ.

Since I don’t think “libcrurl” will be able to offer a compatible API without a considerable effort, I think applications will need to be aware of which of the APIs they work with and then we have a “split world” to deal with for the foreseeable future and that will cause problems, documentation problems and users misunderstanding or just getting things wrong.

Their naming will possibly also be reason for confusion since “libcrurl” and “crurl” look so much like typos of the original names.

We are determined to keep libcurl the transfer library for the internet. We support the full API and we offer full backwards compatibility while working the same way on a vast amount of different platforms and architectures. Why use a copy when the original is free, proven and battle-tested since years?

Rights?

Just to put things in perspective: yes they’re perfectly allowed and permitted to do this. Both morally and legally. curl is free and open source and licensed under the MIT license.

Good luck!

I wish the team working on this the best of luck!

Updates after initial post

Discussions: the hacker news discussion, the reddit thread, the lobsters talk.

Rename? it seems the google library might change name to libcurl_on_cronet.

Update in April 2020:

According to an update to the bug entry dated February 28th 2020:

Remove libcurl_on_cronet and dependencies.

This project was never finished, and we have no current plans to
continue development.

10 thoughts on “Google to reimplement curl in libcrurl”

  1. This is exactly what Microsoft did in the 90’s adopt, extend, extinguish. You adopt a standard, extend it until it is no longer compatible with the standard, and extinguish the original.

  2. @foo: that is completely the wrong argument for this situation. Curl is a library, not really a standard. It leverages HTTP standards. If Google starts creating incompatibilities, the very worst case would be a glibc/musl situation.

  3. Daniel, they are not allowed (legally, unless specifically licensed to do so) to create confusion among the public by abusing the name you established. Open source licenses do not grant the right to cause confusion regarding trademarks, even if the mark is not registered; you would have to abandon it first.

  4. google has lost its mind.
    and whats with the unpronouncable names?
    shame on you, google!

  5. They should be doing the opposite. Retire “cronet” and simply use libcurl as the protocol handler library for Chrome. If that requires making improvements to libcurl, then everyone wins.

    I did this for Citadel [http://www.citadel.org], an email/groupware/CMS system that uses lots of different protocols. ALL of the outgoing protocol handlers were replaced with libcurl, and we dropped tens of thousands of LoC and things got more reliable thanks to libcurl’s extensive testing. Google could easily do the same.

    (By the way … Citadel might be the only MTA that uses libcurl for all of its outbound SMTP handling. It was a fascinating exercise.)

  6. I can agree that using such a similar name is in poor form. Is there a trademark on the Curl and Libcurl names? If so, there could be some legal action, perhaps.

    I believe if Curl were under the AGPLv3, this wouldn’t have happened, if only because they’d be afraid to touch it.

    In any case, we’ll see how this progresses, I suppose. It would be an interesting case study of permissive licensing if you have your project ripped out from under you by the same mechanism that you’ve approved of in the past for proliferating it. I want to stress that I mean nothing rude by this, however.

Comments are closed.