News for hackers. Stuff that matters.
Re:Ladybird Browser adopts Rust by viktorcode on Monday February 23, 2026 @06:47AM (#47121054)
> We previously explored Swift, but the C++ interop never quite got there

But Rust doesn't have C++ interop at all?

Re:Ladybird Browser adopts Rust by nicoburns on Monday February 23, 2026 @06:55AM (#47121148)
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 Browser adopts Rust by wavemode on Monday February 23, 2026 @08:58AM (#47122398)
> You can do it via the C ABI, and use opaque pointers to represent higher-level Rust/C++ concepts

Yeah but, you can do the same in Swift

Re:Ladybird Browser adopts Rust by nicoburns on Monday February 23, 2026 @09:26AM (#47122771)
My understanding from a brief read of the Swift issue is that they kept running into bugs in the Swift compiler which, in practice, prevented them from doing the things that they ought to be do in theory. This went on for long enough, that they got fed up and abandoned Swift.

The Rust compiler is incredibly solid (across all target platforms), and while it's C/C++ interop is relatively simplistic, what does exist is extensively battle tested in production codebases.

Re:Ladybird Browser adopts Rust by tonyedgecombe on Monday February 23, 2026 @06:52AM (#47121119)
>But Rust doesn't have C++ interop at all?

It also doesn't have the disadvantages of Swift. Once the promise of Swift/C++ interop is gone there isn't enough left to recommend it.

Re:Ladybird Browser adopts Rust by skavi on Monday February 23, 2026 @07:20AM (#47121366)
I’m curious what issues people were running into with Swift’s built in C++ interop? I haven’t had the chance to use it myself, but it seemed reasonable to me at a surface level.
Re:Ladybird Browser adopts Rust by stratos123 on Monday February 23, 2026 @07:49AM (#47121653)
There's a list of unsolved problems in this Ladybird issue, now closed because they dropped Swift: https://github.com/LadybirdBrowser/ladybird/issues/933

for example: "Swift fails to import clang modules with #include <math.h> with libstdc++-15 installed. Workaround: None (!!)"

Re:Ladybird Browser adopts Rust by woadwarrior01 on Monday February 23, 2026 @07:42AM (#47121577)
Yeah, that part doesn't make much sense to me. IMO, Swift has reasonably good C++ interop[1] and Swift's C interop has also significantly improved[2] since Swift 6.2.

[1]: https://www.swift.org/documentation/cxx-interop/

[2]: https://www.swift.org/blog/improving-usability-of-c-librarie...

Re:Ladybird Browser adopts Rust by matthewkosarek on Monday February 23, 2026 @07:56AM (#47121724)
There is also cxx.rs, which is quite nice, albeit you have to struggle sending `std` types back and forth a bit
Re:Ladybird Browser adopts Rust by nicoburns on Monday February 23, 2026 @08:07AM (#47121823)
> albeit you have to struggle sending `std` types back and forth a bit

Firefox solves this partly by not using `std` types.

For example, https://github.com/mozilla/thin-vec exists in large part because it's compatible with Firefox's existing C++ Vec/Array implementation (with the bonus that it's only 8 bytes on the stack compared to 24 for the std Vec).

Re:Ladybird Browser adopts Rust by nickorlow on Monday February 23, 2026 @08:27AM (#47122037)
Luckily, ladybird also does not use `std` types
Re:Ladybird Browser adopts Rust by azornathogron on Monday February 23, 2026 @07:29AM (#47121460)
It may have in the future. Crubit is one effort in this direction: https://crubit.rs/
Re:Ladybird Browser adopts Rust by k33n on Monday February 23, 2026 @06:48AM (#47121074)
It's technically Rust -> C -> C++ as it stands right now
Re:Ladybird Browser adopts Rust by the_mitsuhiko on Monday February 23, 2026 @09:06AM (#47122511)
Rust has cxx which I would argue is "good enough" for most use cases. At least all C++ use cases I have. Not perfect, but pretty damn reasonable.