Ladybird Starts Rewriting Its Browser Engine in Rust with Help from AI

The Ladybird browser project introduces Rust alongside C++, porting its JavaScript engine with identical output and zero regressions.

Ladybird, a new browser still in development, has started rewriting parts of its code in Rust. Founder Andreas Kling said the team had looked at Swift as a possible replacement for C++. However, Swift did not work well with C++ and had limited support outside Apple platforms.

“When we originally evaluated Rust back in 2024, we rejected it because it’s not great at C++ style OOP. But after another year of treading water, it’s time to make the pragmatic choice. Rust has the ecosystem and the safety guarantees we need. Both Firefox and Chromium have already begun introducing Rust into their codebases, and we think it’s the right choice for Ladybird too.”

The team is starting with LibJS. Its lexer, parser, abstract syntax tree, and bytecode generator are mostly self-contained and have strong test coverage, including Ladybird’s own regression tests.

The port generated about 25,000 lines of Rust code and took about 2 weeks to complete. People led the process, but AI tools like Claude Code and Codex helped out with hundreds of small prompts.

Testing confirmed that the team met their goal. The Rust version passed 52,898 tests and 12,461 Ladybird regression tests without any new bugs. Developers also said that performance remained the same for all tracked JavaScript tasks.

Right now, the Rust code is designed to match C++ patterns, even in how it handles register allocation, so the compiler output is the same. The team plans to refactor and simplify it later, once they are more confident and can remove some C++ parts.

Developers say the transition will happen slowly. C++ remains the main focus, while Rust versions are being developed as a long-term project. New Rust parts will work with the existing C++ code, with clear rules for their interaction.

For more details, check out the announcement.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

2 Comments

  1. LilyPad

    Was watching Ladybird for some time, but recently made aware, and then doing some research on the founder, it’s a hard stop now. A shame, really.

    Servo is an upcoming engine that shows great promise. Took the test drive, and they are making great progress.

    1. Lady Bug

      What is your problem with Andreas Kling?
      https://awesomekling.com/
      The usual defamation?

Leave a Reply

Your email address will not be published. Required fields are marked *