Ladybird adopts Rust, with help from AI

AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.

Why it matters

Ladybird's Rust port proves AI coding agents can translate critical, correctness-critical code safely when a conformance suite verifies byte-for-byte equivalence, a reusable pattern for teams migrating legacy codebases.

Read this as

Ladybird, an independent web browser project, is switching its underlying programming language from C++ to Rust, a newer language that prevents memory bugs. Its creator Andreas Kling used the AI coding tools Claude Code and Codex to translate a major component in about two weeks of work that would have taken months by hand. The translated code behaves exactly like the original, with no regressions. Anyone maintaining large software projects could apply the same approach.

Ladybird's Andreas Kling ported a 25,000-line JavaScript engine from C++ to Rust in two weeks using human-directed Claude Code and Codex sessions, work he estimates would have taken months manually. The strategy depended on the test262 conformance suite and byte-for-byte output comparison with the original C++ code, making AI-assisted migration verifiable rather than trust-based. Teams with well-tested legacy codebases gain a proven template; projects lacking such test suites still carry the risk.

Andreas Kling used hundreds of small human-steered prompts to Claude Code and Codex to translate Ladybird's LibJS lexer, parser, AST, and bytecode generator to about 25,000 lines of Rust. The hard constraint was byte-for-byte identical output versus the C++ pipeline: every AST and all generated bytecode matched, with zero regressions, verified via the test262 conformance suite. The port took roughly two weeks against an estimated multi-month manual effort. Notably, Kling frames this as human-directed steering, not autonomous code generation.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

Ladybird LibJS Rust Claude Code Codex test262

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading