agreed about rust literally being designed to build a browser, but when it was developed there were many amazing pieces sitting around in c++ :) let the zig folks have a go at building their own ecosystem.
That's why Rust was introduced into Firefox piece by piece. The goal wasn't to rewrite firefox in Rust - just to migrate the scary bits over to a memory safe lang. You can feel a lot of that in the servo codebase, weird pointer semantics as a result of needing to be API compatible with the C++ adapters.
If I were building a company around a new browser, I'd reach for the solid stuff that can be pulled in. Our whole blitz project is designed to be modular exactly for that use-case.
> but when it was developed there were many amazing pieces sitting around in c++ :) let the zig folks have a go at building their own ecosystem.
Servo had Mozilla's backing in that endeavor though, and even then they didn't manage to ship a full browser in a decade, the problem is just that hard.
> Servo had Mozilla's backing in that endeavor though, and even then they didn't manage to ship a full browser in a decade, the problem is just that hard.
Not that hard; Ladybird, with a fraction of the resources available to the servo team, is C++ (Moving to swift soon) and they got pretty damn far.
The lack of velocity in Rust is real; it's a trade-off between velocity and safety, and Ladybird has amply demonstrated just how rapid C++ velocity can be.
And this is coming from someone who doesn't even like C++.
> Not that hard; Ladybird, with a fraction of the resources available to the servo team, is C++ (Moving to swift soon) and they got pretty damn far.
You know the saying about the first 90% and then the second 90%? Making a web browser is the fractal version of that.
> The lack of velocity in Rust is real; it's a trade-off between velocity and safety,
No it's not, Rust has in fact much higher velocity than C++, even at Mozilla which was basically a C++ shop beforehand (and a pretty good one at that).
> and Ladybird has amply demonstrated just how rapid C++ velocity can be.
No, you seem to have a misunderstanding of what servo was. Mozilla didn't use Rust yo make a safer browser, they used Rust to make a faster browser by leveraging all the cores of modern CPUs. That was the primary motive for making Rust in the first place: making multithreading tractable for humans.
As a result, the servo project aimed for SotA performance and modules were rewritten multiple time as they improved the architecture for performance (see the different iterations of Stylo or Webrender, which ended up in Firefox proper when it converged).
That's why it was apparently slow, not because of safety but because it aimed to be the first fully parallel browser (which is something enabled by Rust's safety).
You can argue that Rust has lower velocity than garbage collected language because you need to think about ownership, but not that it has lower velocity than other low-level languages: they too need to think about ownership, they simply have no static check to catch errors at compile time: every error raised by the borrow checker would be as segfault. (And Rust keeps what makes C++ already much higher velocity than C, the ability to build powerful abstractions at no performance cost).