Live data from Hacker News

Ladybird adopts Rust, with help from AI

ladybird.org

401–410 of 731 posts

Re: Ladybird adopts Rust, with help from AI

#401

This is sort of hilarious if you think about it. The Firefox browser is completely written in Rust. Now Ladybird is a "human-directed ai" Rust browser. Makes you wonder how much of the code the two browsers will share going forward given llm assisted autocompletes will pull from the same Rust Browser dataset.

Only a small portion of Firefox is written in Rust. Apparently some of the most performant and least buggy parts are those in Rust, but again, only parts like the CSS engine.

Re: Ladybird adopts Rust, with help from AI

#402

Earlier quoted context omitted.

I still don’t buy this “safer more modern” mentality. Modern C++ pretty much solves the safety issues. People need to learn how to use tools properly. If you ask me, Go is a better Rust. Rust is an ugly version of C++ with longer compile times and a band of zealous missionaries. I mean the keywords mut and fn very annoying to read just get rid of them or spell the f*n thing function.

> People need to learn how to use tools properly. Two things: (1) I see that you are using a throwaway/new account. If throwaway, I have little sympathy for any downvotes that you get. If new, welcome to the community. I hope your share you personal experiences. (2) Nothing gets me more angry than telling highly skilled people it is a "problem between keyboard and chair." ("Oh, you just need to use it correctly.") As…

> C++ is a dying language compared to Rust.

there is a good chance Rust will start dying and will actually die by being replaced by some new hyper-overengineered lang much faster than C++ actually die.

Re: Ladybird adopts Rust, with help from AI

#405
post #18

Earlier quoted context omitted.

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

I’ve been part of at least 2 successful rewrites. I think that Joel’s post is too often taken as gospel. Sometimes a rewrite is the best way forward. Moving Ladybird from C++ to a safer more modern language is a real differentiator vs other browsers, and will probably pay dividends. Doing it now is better than doing it once ladybird is fully established. One last point about rewrites: you can look at any industry dis…

The good news is as of now ladyboy doesn't have any competition.

Rarely if ever is anything able to compete simply by being "better". As far as USPs go it's just not enough. I reckon for ladyboy the USP (if any) is going to be it being open and NOT chrome (or derivative). So "safe" "modern" language is not going to mean much to the end users.

Re: Ladybird adopts Rust, with help from AI

#406
post #95
post #68

Earlier quoted context omitted.

> Coding assistants are also really great at porting from one language to the other I had a broken, one-off Perl script, a relic from the days when everyone thought Drupal was the future (long time ago). It was originally designed to migrate a site from an unmaintained internal CMS to Drupal. The CMS was ancient and it only ran in a VM for "look what we built a million years ago" purposes (I even had written permissi…

> 10/10 - would generate tens of thousands of lines of useless code again. Me too! A couple days ago I gave claude the JMAP spec and asked it to write a JMAP based webmail client in rust from scratch. And it did! It burned a mountain of tokens, and its got more than a few bugs. But now I've got my very own email client, powered by the stalwart email server. The rust code compiles into a 2mb wasm bundle that does ever…

Can you release it as open source code?

Re: Ladybird adopts Rust, with help from AI

#407

Earlier quoted context omitted.

I am somewhat concerned about the volatility. All three languages have their merits and each has a stable foundation that has been developed and established over many years. The fact that the programming language has been “changed” within a short period of time, or rather that the direction has been altered, does not inspire confidence in the overall continuity of Ladybird's design decisions.

> I am somewhat concerned about the volatility. Not just volatility but also flip-flopping. Rust was explicitly a contender when they decided to go with Swift 18 months ago, and they've already done a 180 on it despite the language being more or less the same as it was.

They made a very pragmatic and sensible decision after reviewing Swift that it wouldn't be suitable for their purposes, so they shifted to the next best alternative. I think they reasoned it very well and made a great decision.

Re: Ladybird adopts Rust, with help from AI

#408

Earlier quoted context omitted.

> It burned through a mountain of tokens, but 10/10 - would generate tens of thousands of lines of useless code again. This is the biggest bottleneck at this point. I'm looking forward to RAM production increasing, and getting to a point where every high-end PC (workstation & gaming) has a dedicated NPU next to the GPU. You'll be able to do this kind of stuff as much as you want, using any local model you want. Run a…

Wasting electricity to "generate tens of thousands of lines of useless code" at will? Why is that in any way a desirable future?

A lot of code is "useless" only in the sense that no one wants to buy it and it will never find its way into an end user product. On the other hand, that same code might have enormous value for education, research, planning, exploration, simulation, testing, and so on. Being able to generate reams of "useless" code is a highly desirable future.

Re: Ladybird adopts Rust, with help from AI

#409

Earlier quoted context omitted.

It doesn't have to all-or-nothing. Firefox has been a mixed C++ and Rust codebase for years now. It isn't like the code is written twice. The C++ components are written in C++, and the Rust components are written in Rust. I suspect that'll also be what happens here. And if the use of Rust is successful, then over time more components may switch over to Rust. But each component will only ever be in one language at a t…

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

That choice was never made. C++ was selrcted as the language of choice for SerenityOS. Since the goal of the OS was to make its founder happy, and C++ was his faviourite language at the time, that seems like an obvious choice. Later, as part of SerenityOS, there was a need for an HTML parser. It was written in C++ as was the rest of the operating system. Then that HTML parser evolved into a full web browser. As part of the SerenityOS project, that browser was written completely in C++. Then that web browser forked off into an independent project...

Ladybird was already a fully functioning browser (not finished of course but complete enough to surf many web pages) when it was forked from SerenityOS to create a stand-alone web browser. The choice at that point was "keep evolving the current C++ code base" or start-over. I doubt the second option was even considered.

They have been evaluating other languages since before the fork. Rust was evaluated and rejectd early-on. They even created their own language at one point. https://github.com/SerenityOS/jakt

Re: Ladybird adopts Rust, with help from AI

#410

I wonder what is gained by this port though, if the C++ codebase already employed modern approaches to memory management. It's entirely possible that the Rust version will perform worse too as compilers are less mature.

"modern approaches to memory management" aren't enough for complete memory safety.
Post reply on HN