Live data from Hacker News

Ladybird adopts Rust, with help from AI

ladybird.org

11–20 of 731 posts

Re: Ladybird adopts Rust, with help from AI

#12
post #4

Interestingly editorialized title omits “with help from AI”.

A LLM-assisted codebase migration is perhaps one of the better use cases for them, and interestingly the author advocates for a hands-on approach.

Adding the "with help from AI" almost always devolves the discussion from that to "developers must adopt AI or else!" on the one hand and "society is being destroyed by slop!" on the other, so as long as that's not happening I'm not complaining about the editorialized title.

Re: Ladybird adopts Rust, with help from AI

#14

> We previously explored Swift, but the C++ interop never quite got there But Rust doesn't have C++ interop at all?

You can do it via the C ABI, and use opaque pointers to represent higher-level Rust/C++ concepts if you want to.

Firefox is a mixed C++ / Rust codebase with a relatively close coupling between Rust and C++ components in places (layout/dom/script are in C++ while style is in Rust, and a mix of WebRender (Rust) and Skia (C++) are used for rendering with C++ glue code)

Re: Ladybird adopts Rust, with help from AI

#15
> 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.

Re: Ladybird adopts Rust, with help from AI

#16

Sigh agents keep killing all the passion I have for programming. It can do things way faster than me, and better than me in some cases. Soon it will do everything better and faster than me.

It automates both the fun and the boring parts equally well. Now the job is like opening a box of legos and they fall out and then auto-assemble themselves into whatever we want..

Re: Ladybird adopts Rust, with help from AI

#17

Sigh agents keep killing all the passion I have for programming. It can do things way faster than me, and better than me in some cases. Soon it will do everything better and faster than me.

Not sure why you'd get that from this post, which says it required careful small prompts over the course of weeks.

In the hands of experienced devs, AI increases coding speed with minimal impact to quality. That's your differentiator.

Re: Ladybird adopts Rust, with help from AI

#18
post #7

> 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 f…

This is the famous trap that Joel on Software talked about in a blog post long time ago.

If you do a rewrite you essentially put everything else on halt while rewriting.

If you keep doing feature dev on the old while another "tiger team" is doing the rewrite port then these two teams are essentially in a race against each other and the port will likely never catch up. (Depending on relative velocities)

Maybe they think that they can to this LLM assisted tools in a big bang approach quickly and then continue from there without spending too much time on it.

Re: Ladybird adopts Rust, with help from AI

#20

[flagged]

Ladybird has a strong "all dependencies built in house" philosophy. Their argument is they want an alternative implementation to whatever is used by other browsers. I'd argue they would never use a third party library like servo as a principle.
Post reply on HN