Ladybird web browser begins Rust adoption, starting with JavaScript engine, with AI help

Ladybird web browser begins Rust adoption, starting with JavaScript engine, with AI help

The team behind Ladybird, a cross-platform browser project, has announced that it is beginning a transition to Rust in order to take advantage of its mature ecosystem and memory safety guarantees. This decision follows an evaluation of other languages, including Swift, which was dismissed due to limited platform support and unresolved C++ interoperability challenges, making Rust the more viable choice. Other major browsers, such as Firefox and Chromium, have already introduced Rust into their own codebases, influencing Ladybird's direction.

For their first step, the Ladybird team is porting the LibJS JavaScript engine, focusing on the lexer, parser, abstract syntax tree, and bytecode generator components. The migration process was accelerated through the use of AI-assisted tools like Claude Code and Codex, guided by human input on the sequence and style of the port. This AI-assisted approach reduced the translation time to about two weeks, work that the team estimates would have taken several months if done entirely by hand.

The team has validated that the Rust parser and compiler produce outputs identical to the previous C++ implementation, reporting zero regressions. While Rust adoption will proceed gradually and coexist with ongoing C++ engine development via defined interoperability boundaries, the Ladybird project plans to continue development in both languages for the foreseeable future.

by Paul

ddnnsoul1472
ddnn found this interesting
Ladybird iconLadybird
  61
  • ...

Ladybird is an open-source web browser currently under development, with an anticipated alpha launch in 2026. Rated 5, it emphasizes privacy and user experience with features such as no tracking and an ad-free environment. As an independent browser, Ladybird aims to offer an alternative to mainstream options, focusing on user-centric browsing without intrusive elements.

Comments

UserPower
0

"The result was about 25,000 lines of Rust, and the entire port took about two weeks. The same work would have taken me multiple months to do by hand."

By "multiple months", he surely means more than a month, because it's a very simple OOP code translation, and now the resulting code feels just like it was written by someone that never heard of Rust.

Learning the language then making the manual changes would have been much pleasant for contributors to work with this new code, maybe improved the whole project, but it would have been less fun, for sure.

So now, why just not stick with modern C++? Certainly for the same reason Swift has been chosen in the first place: it's quite fun to start something else instead of finishing what you've started.

2 replies
TheoKoenig

I find yout judgement a bit harsh. "More than a month" is already a long time for a team that I'm sure has loads to do.

rickiethadragon

I appreciate your contribution brother!! Eevryone should just enjoy the software and for God Sakes User Power why in the hell are yo being negative for insomething that honestly has nothin to do with you! I dont get that! They call that pessimism!

Gu