Rewriting is the cheap half

3 min read

Daniel Stenberg, who has maintained curl for decades, wrote on 17 November about two AI-assisted rewrites of curl in Rust. By his account, one of them turned about 185,000 lines of C into about 340,000 lines of Rust. In roughly the same few weeks, more than 300 commits were merged into the real curl, a little over 200 of them bugfixes. His reaction, in his words: “I’m amused. A little puzzled. Fascinated.”

His argument is that writing the code once was never the hard part. The value is in maintaining it, and that, he says, is “not because of the chosen language it is implemented in”. He also writes that he does not believe in rewrites into any language; he prefers constant, never-ending polishing and refactoring.

No standing to sneer

I would be a poor person to take the other side. I have rewritten the same crawl-and-extract idea in five languages, and the fetching in my current one runs on libcurl, so I have a quiet stake in Stenberg staying unbothered. I have also kept Crisp running on my own since 2020. I know what the second half costs, and it has never been the typing.

The typing is the part that feels like progress. A rewrite gives you a clean tree, a new language to enjoy and a week of momentum. The bill comes later, in the months of keeping the thing correct while the world it reads keeps changing underneath it.

Why the AIs could do it

The line in Stenberg’s post I keep returning to is his explanation of why the rewrites were possible at all. The AIs had curl’s well-documented C code, its tests, and the many applications built on its API to learn from. The old behaviour was pinned down in public, in three different ways.

A rewrite is cheap exactly when the behaviour it must reproduce is written down. That makes the pinning the asset, and the code a view on it. Whoever holds the tests and the contract holds the project, whatever language is on top.

Two kinds of cheap

Code has become cheap to regenerate, and Stenberg’s post is a fair measure of how far it has gone. The record of what correct looks like has not become cheap. Someone has to collect real cases, decide what each answer should be, and be right often enough that a disagreement with them means something.

This is also why I start from the contract and the deployment pipeline, and leave the source for last; I call it Deployment Driven Development. By the time the code arrives, the question of whether it is right already has an answer sitting next to it.

Stenberg asks whether the rewrites are more than proofs of concept. My own answer for my own rewrites is simple. They stop being proofs of concept on the day they pass what the old ones passed.

Source: Daniel Stenberg, “Actual curl rewrites in Rust”, 17 November 2026.