this post was submitted on 23 Feb 2026
82 points (77.0% liked)

Technology

81759 readers
3504 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related news or articles.
  3. Be excellent to each other!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, this includes using AI responses and summaries. To ask if your bot can be added please contact a mod.
  9. Check for duplicates before posting, duplicates may be removed
  10. Accounts 7 days and younger will have their posts automatically removed.

Approved Bots


founded 2 years ago
MODERATORS
 

Lobsters.

We’ve been searching for a memory-safe programming language to replace C++ in Ladybird for a while now. We previously explored Swift, but the C++ interop never quite got there, and platform support outside the Apple ecosystem was limited. Rust is a different story. The ecosystem is far more mature for systems programming, and many of our contributors already know the language. Going forward, we are rewriting parts of Ladybird in Rust.

you are viewing a single comment's thread
view the rest of the comments
[–] XLE@piefed.social 5 points 1 day ago (1 children)

Is it a good sign for Rust code when it's described as having "a strong 'translated from C++' vibe"? Or when the developer says too much Rust might be something they "can't merge"?

[–] eager_eagle@lemmy.world 1 points 1 day ago* (last edited 1 day ago) (1 children)

out of context?

Please coordinate with us before starting any porting work so nobody wastes their time on something we can’t merge.

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.

that seems reasonable to me

[–] XLE@piefed.social 2 points 1 day ago (1 children)

But is it a good idea to just translate something from C++ like that? It seems technically feasible but there's something "off" about the whole thing.

Like the developer originally talked about switching to Swift, then decided not to switch to Swift.

And previously, "Ladybird devs have been very vocal about being 'anti-rust' (I guess more anti-hype, where Rust was the hype)."

Apparently you can translate C++ directly to Rust, but anecdotal statements claim that while Rust supports C++ conventions, you wouldn't typically build a Rust app using them.

It all just suggests rudderlessness from the developers right now.

[–] eager_eagle@lemmy.world 2 points 1 day ago (2 children)

Why it wouldn't be? Surely not having idiomatic rust doesn't eliminate other benefits of switching to the language, like better tooling, memory safety, and perhaps more people willing to contribute. Over time the codebase can be improved but the main goal in the transition seems to not break existing functionality, which they seem to have accomplished for LibJS.

[–] CameronDev@programming.dev 2 points 18 hours ago (1 children)

I haven't looked at the code, but the mem safety may be out if the translation just slapped unsafe and transmute everywhere.

And "working code" is often very hard to replace, it can be hard to justify code changes when the original "works just the same". So, I would expect the weird ported code to live on unless there is a major effort to rewrite it.

[–] eager_eagle@lemmy.world 2 points 18 hours ago (1 children)

There's no reason to believe it's mostly unsafe. And even if that's the case, changing from unsafe rust to safe is less of a leap than cpp to rust.

[–] CameronDev@programming.dev 1 points 17 hours ago* (last edited 17 hours ago)

Having done some C to rust auto-translation some time ago, it definitely was wildly unsafe. Maybe it's better now, but there is no reason to assume it's mostly safe now either. Even recently I did some regular vibe coding to test it out, and it generated some very questionable code.

Even if there is zero "unsafe", there could be loads of unchecked array accesses, or unwraps causing panics, which while "safe", will cause crashes.

Fixing unsafe can be a mixed bag, some will be easy, some will require much deeper changes. And without looking at the code, impossible to say which it will be.

[–] XLE@piefed.social 2 points 22 hours ago (1 children)

I don't think "why not" is a great response in general - especially when the same developer also invested time in Swift that was ultimately wasted.

[–] eager_eagle@lemmy.world 2 points 21 hours ago

It's not a why not response. I'm asking back why do you think it wouldn't be worth it even as a literal translation from C++, because in my view, that would be a first step towards a proper Rust port, and it still brings benefits to the table.