curl's Rust rewrites are behind already
Daniel Stenberg has spent years answering the same question: why not rewrite curl in Rust? This fall, two projects did it anyway. One is urlx, described as a memory-safe, from-scratch reimplementation of curl and libcurl. The other is kov/curl, described as a rewrite of curl and libcurl in Rust, confusingly using the same name. Stenberg says the second project claims to have spent $8,600 on the effort. He counted 185,000 lines of C converted into 340,000 lines of Rust in a little more than three weeks.
His response is not a rejection of Rust. It is a rejection of the idea that a rewrite is the hard part. During the same three weeks, the actual curl project merged over 300 commits, including a little over 200 bugfixes, and fixed a few vulnerabilities. The clones had a snapshot of the code. curl had a moving target, a community, and a maintenance process. That gap is the story.
What the rewrites actually did
The two projects are interesting because they were built with AI assistance. Stenberg says the models have trained on curl's code for years, and curl is unusually well documented: many applications use its API, and thousands of test cases verify its behavior. That makes it an ideal target for a code-generation experiment. The model does not have to invent the behavior; it has to translate an existing implementation and polish until the tests pass.
The kov/curl project claims to have spent $8,600, presumably on model tokens and compute. Stenberg does not verify the figure; he reports it as the project's claim. The line count is his own: 185,000 lines of C became 340,000 lines of Rust. The Rust version is larger, which is not surprising for a translation that adds explicit error handling, ownership, and type definitions. A rewrite can be more verbose and still be correct.
The important word is "snapshot." A rewrite reproduces what curl was at a particular moment. It does not automatically inherit the bugfixes, the security patches, the ABI guarantees, or the behavior changes that land after the snapshot. The Rust projects can track upstream, but tracking is work. Every upstream commit has to be understood, translated, and tested against the Rust implementation. The more successful curl is, the more work the clones have to do to stay current.
The maintenance gap
Stenberg's core argument is that writing code once was never the big deal. curl is the result of decades of decisions, feedback, and iteration. The C code is a specification of what curl does today, but the project's value is in the process that keeps changing it. A clone can copy the specification. It cannot copy the process.
The numbers make the gap concrete. In a little more than three weeks, curl merged over 300 commits, including over 200 bugfixes, and fixed a few vulnerabilities. Those changes are not cosmetic. They include fixes for edge cases that users reported, compatibility adjustments, and security hardening. A Rust rewrite that does not track them is already behind. A rewrite that does track them has taken on the maintenance burden of a second implementation.
That burden is not just code. curl has an ABI and API stability promise that spans decades. Applications link against libcurl and expect the symbols and behavior to remain compatible. A Rust rewrite can offer a compatible API, but it has to prove that compatibility across platforms, build systems, and language bindings. That is a long-term commitment, not a weekend translation.
There is also the community. curl's users report bugs, test release candidates, and contribute fixes. A new project starts with no such community. It can attract one, but that takes years. The Rust rewrites may be useful experiments, and they may attract contributors who prefer Rust. They are not yet a replacement for the project they copied.
Memory safety helps, but not as much as the slogan
Stenberg gives a number that should be quoted in every "rewrite it in Rust" debate. Out of 81 vulnerabilities confirmed in curl during 2026, 14 were the result of mistakes that most likely would have been avoided with a memory-safe language such as Rust. That is 17.3%. A Rust implementation would still have had 67 of those vulnerabilities.
The math is not an argument against Rust. It is an argument against treating memory safety as a complete security strategy. Most curl vulnerabilities are not buffer overflows. They are logic errors, protocol mistakes, parsing edge cases, and API misuse. Rust can prevent a class of memory-safety bugs, but it cannot prevent a developer from implementing the wrong state machine or accepting the wrong certificate. Those bugs require review, testing, and fuzzing regardless of the language.
The 17.3% figure is specific to curl in 2026. It is not a universal estimate. A different codebase with a different bug distribution might see a larger or smaller benefit. But the direction is clear: memory safety is a real improvement, and it is not a silver bullet. A rewrite that focuses only on the language and ignores the process will inherit most of the old bugs and add new ones.
Why AI makes rewrites cheaper
The AI angle is what makes this fall's experiments notable. A few years ago, a from-scratch curl rewrite would have been a multi-year project. Now a small team, or even one person with an agent, can produce a working translation in weeks. That is a genuine change in the economics of code generation. It does not change the economics of maintenance.
The reason is that the model has seen the code before. curl is one of the most widely distributed C codebases in the world. Its source, documentation, and tests are in the training data. The model can pattern-match the C implementation and produce Rust that passes the tests. That is impressive, but it is closer to translation than to engineering. The hard cases are the ones the tests do not cover, and those are exactly the cases that generate bug reports.
AI can also help with maintenance. It can suggest fixes, summarize commits, and generate tests. But it does not remove the need for a maintainer to decide what to accept. The Btrfs project's proposed AGENTS.md file is a response to the same problem: generating patches is cheap, reviewing them is not. A curl clone that tracks upstream will face the same review bottleneck.
What a rewrite would have to match
It is worth being concrete about the surface a curl rewrite has to cover. libcurl exposes a C API and ABI that applications have linked against for years. A Rust implementation can expose the same symbols, but it has to preserve the same struct layouts, callback conventions, error codes, and default behaviors. It also has to work on the same platforms, with the same TLS backends, the same DNS resolvers, and the same build systems. That is not impossible; it is a specification problem on top of a coding problem.
The test suite is another asset. curl has thousands of test cases, including protocol tests, fuzzing corpora, and regression tests for old bugs. A rewrite can reuse those tests, which is why the AI-assisted projects were able to make progress quickly. But passing the tests is a floor, not a ceiling. The tests encode known behavior; they do not encode the judgment that went into the behavior. A rewrite can pass the suite and still break an application that depends on an undocumented quirk.
Fuzzing is the other hidden asset. curl has been fuzzed for years, and its corpus contains inputs that once caused crashes. A rewrite can start from that corpus, but it needs its own continuous fuzzing, its own sanitizer runs, and its own triage process. Those are ongoing costs, not one-time setup. A project that passes the existing tests and stops there has reproduced a snapshot of curl's quality, not the process that produced it.
Then there is the release process. curl ships frequently, with a security release cadence and a public vulnerability database. A rewrite has to decide how it will handle security reports, assign CVEs, coordinate disclosure, and backport fixes. Those are organizational capabilities, not language features. The Rust projects may build them over time, but they do not inherit them from the code they copied.
This is not an argument that rewrites are impossible. It is an argument that the cost is dominated by the parts that are not visible in a line count. The 185,000 lines of C are the easy part to measure. The years of bug reports, compatibility decisions, and release management are the part that makes the code worth rewriting.
The vulnerability number deserves the same nuance. Stenberg says 14 of 81 curl vulnerabilities in 2026 were likely avoidable with a memory-safe language. That does not mean a Rust rewrite would have 14 fewer bugs in total. It might have different bugs, including new ones introduced by the translation. The 17.3% is an estimate of the share that memory safety could address, not a guarantee of a 17.3% improvement in security outcomes. The only way to know is to run the rewrite in production and compare, which is exactly the long-term work the clones have not yet done.
What this means for Rust adoption
The curl story is a useful corrective to two opposite mistakes. The first is "rewrite everything in Rust." The second is "Rust is unnecessary because memory safety is overrated." Both are too simple. Rust is a good choice for new code, especially code that parses untrusted input. It is a harder choice for a mature project with a large C codebase, a stable ABI, and a community that depends on incremental improvements.
The incremental path is less exciting but more realistic. Projects can add Rust components behind stable interfaces, use Rust for new tools and bindings, and keep the C core where it is. Stenberg's post does not propose a rewrite. His argument is about process, not language. He believes in constant polishing, iterating, and refactoring, not in a one-time translation.
For Rust developers, the lesson is to be humble about rewrites. A rewrite is a new project with a new maintenance burden. It can be worth doing if the old code is unmaintainable or if the new language unlocks a capability that the old one cannot provide. It is not worth doing just because the language is safer. Safety is a property of the whole system, including the tests, the review, and the release process.
What to watch
The first question is whether the Rust rewrites track upstream. If they do, they become a second implementation with a real maintenance cost. If they do not, they will drift and become a historical snapshot. The second is whether they attract users. A rewrite with no users is a proof of concept, regardless of how many tests it passes. The third is whether the security claims hold up under adversarial review. A memory-safe rewrite can still have logic bugs, and those bugs may be easier to find because the code is new.
For the curl project, the watch item is the vulnerability rate. If memory-safe components reduce the 17.3% share over time, that is evidence for incremental adoption. If the rate stays flat, it suggests that the dominant risks are elsewhere. Either way, the project's process is the thing to study, not just the language of the code.
Stenberg's post ends with a joke about imitation and mediocrity. The joke is pointed, but the underlying point is serious. A rewrite can imitate the code. It cannot imitate the years of work that made the code worth rewriting.