HeadlinesBriefing favicon HeadlinesBriefing.com

Ladybird Browser Shifts to Rust

Hacker News •
×

Ladybird Browser has selected Rust as its memory-safe programming language to replace C++. Founder Andreas Kling announced the decision after previously evaluating Swift but finding platform limitations outside Apple's ecosystem. The move follows similar adoption by Firefox and Chromium, positioning Ladybird to leverage Rust's growing systems programming ecosystem and safety guarantees.

The first port targets LibJS, Ladybird's JavaScript engine. Kling used AI tools (Claude Code and Codex) for the human-directed translation, creating about 25,000 lines of Rust in just two weeks - a process that would have taken months manually. The translation maintained C++ patterns initially to ensure identical output, with the lexer, parser, AST, and bytecode generator as initial components.

The Rust implementation achieved zero regressions across 52,898 tests and 12,461 Ladybird regression tests, with identical AST and bytecode output. While porting will continue as a sidetrack to the main C++ development, the core team will manage the process to maintain compatibility. The translated code currently mimics C++ patterns, with plans to refactor to more idiomatic Rust after the C++ pipeline is retired.