Live data from Hacker News

Ladybird adopts Rust, with help from AI

ladybird.org

561–570 of 731 posts

Re: Ladybird adopts Rust, with help from AI

#561
post #263

Earlier quoted context omitted.

Why not go full functional programming at that point? If the main issue with FP has been accessibility, then it should really take off now.

When you do fully value-oriented programming in Rust (i.e. no interior mutability involved) that's essentially functional programming. There's mutable, ephemeral data involved, but it's always confined to a single well-defined context and never escapes from it. You can even have most of your code base be sans-IO, which is the exact same pattern you'd use in Haskell.

I actually like rust more than Haskell, but `You can even have most of your code base be sans-IO, which is the exact same pattern you'd use in Haskell.` glosses over the fact that in Haskell it's enforced at compile time.

Re: Ladybird adopts Rust, with help from AI

#562

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

Andreas is not some kind of hustler. He spent years writing an entire OS (Serenity OS) before the web browser part happened to gain traction. If you were just trying to be an entrepreneur, why do that?

The truth is more simple: he's a good engineer and leader, people recognised that and offered him sponsorships, and the project took off by itself.

Re: Ladybird adopts Rust, with help from AI

#563
post #388

Earlier quoted context omitted.

I hope, with the velocity unlocked by these tools, that more pure ports will become the norm. Before, migrations could be so costly that “improving” things “while I’m here” helped sell doing the migration at all, especially in business settings. Only to lead to more toil chasing those phantom bugs.

One of the biggest point of rewriting is you know better by then so you create something better. This is a HUUUGE reason code written in rust tended to be so much better than the original (which was probably written in c++). Human expertise is the single most important factor and is more important than language. Copy pasting from one language to another is way worse than complete rewrite with actual idiomatic and use…

These are two different kinds of rewrites, for two different kinds of codebases, in two different situations. The important thing is to know which kind of rewrite you're doing, and have the whole team onboard.

The sort of rewrite you're talking about can work well at an early stage of a project, in the spirit of Fred Brooks's "plan to throw one away". But for a mature browser like Ladybird that's trying to not break the user experience, it's much better to have a pure translation step, and then try to improve or refactor it later.

Re: Ladybird adopts Rust, with help from AI

#564
post #31
post #6

developers with good taste like Andreas Kling will be able to design entire OSes with coding agents

This comment raises an interesting question: Would Serenity OS have brought Andreas the same kind of serenity had it been developed with AI? Open candid question.

I like the idea that people are either coders or builders. So AI can help fulfill your desire to build, create, bring things into reality. But it can't satisfy you if you like programming for its own sake. SerenityOS was not a practical project, it was clearly done for the enjoyment of programming itself.

The project's use of AI now echoes that - it's not being used to create new features, it's used for practical, boring drudge work of translating between two languages. So still very much on brand.

Re: Ladybird adopts Rust, with help from AI

#565
post #558

Earlier quoted context omitted.

Indeed, and as a school those 18 months are well worth it, but it is in many ways also 18 months wasted. There is a strong sense of NIH with the Ladybird dev(s), and I wonder if that isn't their whole reason for doing this. I've seen another team doing something similar, they went through endless rewrite cycles of a major package but never shipped, and eventually the project was axed when they proposed to do it all o…

The sense of NIH is from Serenity, and that was probably the reason for Jakt's existence too. Now it's spun off into its own project there is a lot more pragmatism.

Well, here's to hoping because we really need a stand-in for FF. I realize the irony here in terms of that being the ultimate 'NIH' project but that one I can get behind because the browser landscape is much too fragile. Of course they might end up taking users away from FF rather than from Chrome, Edge or Safari.

Re: Ladybird adopts Rust, with help from AI

#566

Earlier quoted context omitted.

You can't compare the choices made to evolve a >20 years old codebase with a brand new one. Firefox also as Rust support for XPCOM components, so you can use and write them in Rust without manual FFI (this comes with some baggage of course). The Ladybird devs painted themselves in a corner when choosing C++ for a new web browser, with many anti-Rust folks claiming that "modern C++ was safe". Well...

> The Ladybird devs painted themselves in a corner when choosing C++ for a new web browser, with many anti-Rust folks claiming that "modern C++ was safe". Well... Perhaps, but in fairness the project was started in 2018 when Rust was still new and unproven. > You can't compare the choices made to evolve a >20 years old codebase with a brand new one. I guess not, but I'm pretty optimistic about Ladybird's ability to a…

> Perhaps, but in fairness the project was started in 2018 when Rust was still new and unproven.

Rust was already proven in 2018, and I'm pretty sure they went with C++ for other reasons.

Re: Ladybird adopts Rust, with help from AI

#567
post #160

Earlier quoted context omitted.

Not the case with spark. But I understand it requires writing lot of things from scratch for browsers. But I don’t think portability will be an issue with Ada, it is cross platform. However, this is where d shines. D has a mature ecosystem. Offers first class cpp abi and provides memory safety guarantees, which the blog mentioned as a primary factor. And d is similar to cpp, low barrier for cpp devs to pick up.

There's no dynamic memory allocation with (100%) Spark. That's really limiting. You can to write "unsafe" code, but that has the same problems as Ada.

I thought SPARK got dynamic memory allocation when it adopted Rust-style ownership and borrowing in 2014.

Re: Ladybird adopts Rust, with help from AI

#569
post #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.…

This is the way. This exact workflow is my sweet spot. In my coding agent std::slop I've optimized for this workflow https://github.com/hsaliak/std_slop/blob/main/docs/mail_mode... basically the idea is that you are the 'maintainer' and you get bisect safe, git patches that you review (or ask a code reviewer skill or another agent to review). Any change re-rolls the whole stack. Git already supports such a flow and I…

This is broadly how I worked when I was still using chat instead of cli agents for LLM support. The downside, I feel, is that unless this is a codebase / language / architecture I do not know, it feels faster to just code by hand with the AI as a reviewer rather than a writer.

Re: Ladybird adopts Rust, with help from AI

#570

Earlier quoted context omitted.

Not sure I understand, wouldn’t a webmail client in rust need client code like this or to use a library like this?

Yeah but it’s like saying, “why are you impressed with Claude making a car when there are plans for an engine online?”. Even if Claude used that code (it didn't), it made the whole car. Not just an engine. There’s a lot more stuff going on than simply calling a backend mail server over jmap. And fyi, jmap is just a protocol for doing email over json & http. It’s not that hard to roll your own. Especially in a web bro…

Your initial claim talked about jmap and this looks to me like a full implementation of the RFC in rust. That is the hard part of an email client IMO so I’m not sure I’d agree with your analogy, but you’re saying it made a web app which called a library like this?

Would be interesting to see it, did you publish it yet?

Post reply on HN