> We know the result isn’t idiomatic Rust, and there’s a lot that can be simplified once we’re comfortable retiring the C++ pipeline. That cleanup will come in time.
Correct me if I’m wrong since I don’t know these two languages, but like some other languages, doing things the idiomatic way could be dramatically different. Is “cleanup” doing a lot of heavy lifting here? Could that also mean another complete rewrite from scratch?
A startup switching languages after years of development is usually a big red flag. “We are rewriting it in X” posts always preceded “We are shutting down”. I wish them luck though!
> I used Claude Code and Codex for the translation. This was human-directed, not autonomous code generation. I decided what to port, in what order, and what the Rust code should look like. It was hundreds of small prompts, steering the agents where things needed to go. After the initial translation, I ran multiple passes of adversarial review, asking different models to analyze the code for mistakes and bad patterns.
> The requirement from the start was byte-for-byte identical output from both pipelines. 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. We’ve verified that every AST produced by the Rust parser is identical to the C++ one, and all bytecode generated by the Rust compiler is identical to the C++ compiler’s output. Zero regressions across the board
This is the way. Coding assistants are also really great at porting from one language to the other, especially if you have existing tests.
I'm a long-time Rust fan and have no idea how to respond. I think I need a lot more info about this migration, especially since Ladybird devs have been very vocal about being "anti-rust" (I guess more anti-hype, where Rust was the hype).
I don't know if it's a good fit. Not because they're writing a browser engine in Rust (good), but because Ladybird praises CPP/Swift currently and have no idea what the contributor's stance is.
At least contributing will be a lot nicer from my end, because my PR's to Ladybird have been bad due to having no CPP experience. I had no idea what I was doing.
A lot of the previous calculus around refactoring and "rewrite the whole thing in a new language" is out the window now that AI is ubiquitous. Especially in situations where there is an extensive test suite.
All the best to them, however this feels like yah shaving instead of focusing into delivering a browser than can become an alternative to Safari/Chrome duopoly.
I know he doesn't make live coding videos anymore, but it'd be cool if Andreas showed off how this worked a little more. I'm curious how much he had to fix by hand (vs reprompting or spinning a different model or whatever).
> We previously explored Swift, but the C++ interop never quite got there, and platform support outside the Apple ecosystem was limited.
Why was there ever any expectation for Swift having good platform support outside Apple? This should have been (and was to me) already obvious when they originally announced moving to Swift.
Very happy to see this. Ladybird's engineering generally seems excellent, but the decision to use Swift always seemed pretty "out there". Rust makes a whole lot more sense.
Cool, that seems like a rational choice. I hope this will help Ladybird and Servo benefit from each other in the long run, and will make both of them more likely to succeed
Someone should try this with the “Ralph Wiggum loop” approach. I suspect it would fail spectacularly, but it would be fascinating to watch.
Personally, I can’t get meaningful results unless I use the tool in a true pair-programming mode—watching it reason, plan, and execute step by step. The ability to clearly articulate exactly what you want, and how you want it done, is becoming a rare skill.
> We know the result isn’t idiomatic Rust, and there’s a lot that can be simplified once we’re comfortable retiring the C++ pipeline. That cleanup will come in time.
I wonder what kind of tech debt this brings and if the trade off will be worth whatever problems they were having with C++.
Looks like Andreas is a mighty fine engineer, but he's even better entrepreneur. Doesn't matter if intentional or not, but he managed to create and lead a rather visible passion project, attract many contributors and use that project's momentum to detach Ladybird into a separate endeavor with much more concrete financial prospects.
The Jakt -> Swift -> Rust pivots look like the same thing on a different level. The initial change to Swift was surely motivated by potential industry support gain (i believe it was a dubious choice from purely engineering standpoint).
It's awe-inspiring to see how a person can carve a job for himself, leverage hobbyists'/hackers' interest and contributions, attract industry attention and sponsors all while doing the thing he likes (assuming, browsers are his thing) in a controlling position.
Can't fully rationalize the feeling, but all of this makes me slightly wary. Doesn't make it less cool to observe from a side, though.
> After the initial translation, I ran multiple passes of adversarial review, asking different models to analyze the code for mistakes and bad patterns.
I feel like you just know it’s doomed. What this is saying is “I didn’t want to and cannot review the code it generated” asking models to find mistakes never works for me. It’ll find obvious patterns, a tendency towards security mistakes, but not deep logical errors.
> This is not becoming the main focus of the project. We will continue developing the engine in C++, and porting subsystems to Rust will be a sidetrack that runs for a long time.
I don't like this bit. Wouldn't it be better to decide on a memory-safe language, and then commit to it by writing all new code in Rust, or whatever. This looks like doing double the work.
The byte-for-byte identical output requirement is the smartest part of this whole thing. You basically get to run the old and new pipelines side by side and diff them, which means any bug in the translation is immediately caught. Way too many rewrites fail because people try to "improve" things during the port and end up chasing phantom bugs that might be in the old code, the new code, or just behavioral differences.
Also worth noting that "translated from C++" Rust is totally fine as a starting point. You can incrementally make it more idiomatic later once the C++ side is retired. The Rust compiler will still catch whole classes of memory bugs even if the code reads a bit weird. That's the whole point.
> If you look at the code, you’ll notice it has a strong “translated from C++” vibe. That’s because it is translated from C++. The top priority for this first pass is compatibility with our C++ pipeline. The Rust code intentionally mimics things like the C++ register allocation patterns so that the two compilers produce identical bytecode. Correctness is a close second. We know the result isn’t idiomatic Rust, and there’s a lot that can be simplified once we’re comfortable retiring the C++ pipeline.
Does this still get you most of the memory-safety benefits of using Rust vs C++?
> We will continue developing the engine in C++, and porting subsystems to Rust will be a sidetrack that runs for a long time.
So, even though they want the code base to be in Rust, they will continue writing new code in C++ and then translating it to Rust later to remove the C++ they just added.
There must be a really good reason for this, such as Rust doesn’t interop well with C++, otherwise this seems like a poor decision.
Score Breakdown
+0.10
PreamblePreamble
Medium F: Recognition of collaborative effort and inclusive values (contributors, ecosystem, deliberate coordination)
Editorial
+0.05
Structural
ND
SETL
ND
Combined
ND
Context Modifier
ND
Text frames the work as collective and thoughtful decision-making. Implicit commitment to orderly collaboration and shared goals aligns mildly with dignity and cooperation themes in Preamble.
ND
Article 1Freedom, Equality, Brotherhood
No observable signal regarding equality, dignity, or reason and conscience.
ND
Article 2Non-Discrimination
No observable signal regarding discrimination or distinction.
ND
Article 3Life, Liberty, Security
No observable signal regarding right to life, liberty, or security of person.
ND
Article 4No Slavery
No observable signal regarding slavery or servitude.
ND
Article 5No Torture
No observable signal regarding torture or cruel treatment.
ND
Article 6Legal Personhood
No observable signal regarding right to recognition as person before law.
ND
Article 7Equality Before Law
No observable signal regarding equal protection and freedom from discrimination.
ND
Article 8Right to Remedy
No observable signal regarding remedy for violation of rights.
ND
Article 9No Arbitrary Detention
No observable signal regarding arrest or detention.
ND
Article 10Fair Hearing
No observable signal regarding fair and public hearing.
ND
Article 11Presumption of Innocence
No observable signal regarding criminal presumption of innocence or retroactive law.
ND
Article 12Privacy
No observable signal regarding privacy, family, or correspondence.
ND
Article 13Freedom of Movement
No observable signal regarding freedom of movement.
ND
Article 14Asylum
No observable signal regarding asylum or refuge.
ND
Article 15Nationality
No observable signal regarding nationality.
ND
Article 16Marriage & Family
No observable signal regarding marriage and family.
ND
Article 17Property
No observable signal regarding property rights.
ND
Article 18Freedom of Thought
No observable signal regarding freedom of thought and conscience.
+0.39
Article 19Freedom of Expression
Medium A: Open publication of technical decision-making rationale P: Publicly accessible blog post with transparent reasoning F: Framing of decision as one that 'will be controversial' invites public discourse
Editorial
+0.25
Structural
+0.30
SETL
-0.12
Combined
ND
Context Modifier
ND
Content demonstrates freedom of expression through transparent publication of technical decisions. Author explicitly invites disagreement ('I know this will be controversial'). Post is freely accessible, supporting information exchange and opinion formation.
+0.20
Article 20Assembly & Association
Medium A: Invitation to peaceful contribution and coordination F: Emphasis on collaborative, non-autonomous decision-making
Editorial
+0.15
Structural
ND
SETL
ND
Combined
ND
Context Modifier
ND
Text explicitly requests coordination and collaboration ('Please coordinate with us before starting any porting work'). Governance structure emphasizes deliberate, managed process rather than unilateral action. Modest signal of structured collective participation.
+0.13
Article 21Political Participation
Low P: Core team management of porting effort F: Deliberate governance of contribution process
Editorial
+0.10
Structural
+0.05
SETL
+0.07
Combined
ND
Context Modifier
ND
Structure indicates managed participation in project decisions by core team; broader public voice in governance not explicitly addressed. Mildly positive signal regarding order and process, but limited evidence of democratic participation or universal voice.
ND
Article 22Social Security
No observable signal regarding social security or welfare rights.
ND
Article 23Work & Equal Pay
No observable signal regarding work, employment, or just conditions of work.
ND
Article 24Rest & Leisure
No observable signal regarding rest and leisure.
ND
Article 25Standard of Living
No observable signal regarding standard of living or health.
+0.26
Article 26Education
Medium P: Open-source project structure (implicit) enabling access to technical education and knowledge A: Transparent documentation of technical process and reasoning F: Detailed explanation of methodology aids understanding and learning
Editorial
+0.20
Structural
+0.15
SETL
+0.10
Combined
ND
Context Modifier
ND
Post serves educational function by documenting technical decision-making, methodologies, and results in accessible language. Freely available blog post supports right to education and technical literacy. Open-source context (inferred from domain) further supports this. Modest positive signal.
+0.35
Article 27Cultural Participation
Medium A: Protection and development of scientific and technical achievement (adopting memory-safe language) P: Open-source contribution model enabling participation in cultural and technical life F: Detailed explanation of technical work invites participation in shared knowledge
Editorial
+0.25
Structural
+0.20
SETL
+0.11
Combined
ND
Context Modifier
ND
Content documents technical achievement (Rust porting) and participates in shared scientific and technical development. Open publication supports participation in cultural life of scientific community. Coordination language supports collaborative benefit-sharing.
+0.13
Article 28Social & International Order
Low P: Structured governance and coordination process
Editorial
+0.10
Structural
+0.05
SETL
+0.07
Combined
ND
Context Modifier
ND
Text references 'social order' implicitly through emphasis on deliberate management and coordination. Limited direct evidence regarding right to social order for individual development.
+0.10
Article 29Duties to Community
Low F: Recognition of duties to community through coordination requirements
Editorial
+0.05
Structural
ND
SETL
ND
Combined
ND
Context Modifier
ND
Modest signal through emphasis on responsible collaboration and coordination with community. Text requests contributors respect project governance, implying duties to collective.
ND
Article 30No Destruction of Rights
No observable signal regarding prohibition of rights destruction or limitation beyond legal necessity.