Hacker News new | ask | show | jobs
by fregonics 716 days ago
If I'm not wrong Firefox is already Rust. The language was even created inside Mozilla.
2 comments

Only around 11% of it is Rust according to https://4e6.github.io/firefox-lang-stats/ , which by the way is no small feat given how huge the code base is.
It is. They realized that writing a modern browser (i.e. one that for example uses multiple cores efficiently by doing layout/rendering/etc in parallel) is almost impossible in C++. To the point where creating a whole new language just to solve the problem would be a smaller undertaking. Which says something about the scope of this problem. And I really do think they are right.
> writing a modern browser (i.e. one that for example uses multiple cores efficiently by doing layout/rendering/etc in parallel) is almost impossible in C++

C++ also happens to be the only language in which that has been accomplished, so far. (The Rust components are relatively smaller, about 11% according to sibling comments.)

See also: AAA video games

Why is it almost impossible? I'm a little out of practice with C++ but I thought the modern C++ features were considered pretty solid in regards to memory safety and the like?
C++ has indeed added many features that help with memory safety, at the cost of getting increasingly more complicated and harder to work with.
c++ isn't memory safe and will probably never be. that being said, it's not more or less possible to create an efficient browser engine for multicore systems with c++ than any other language. programming language is not the thing that makes the task difficult.
As I said, I'm pretty out of practice, but doesn't stuff like unique_ptr give you a lot of memory-safe features out of the box?
Not really, no
> They realized that writing a modern browser (i.e. one that for example uses multiple cores efficiently by doing layout/rendering/etc in parallel) is almost impossible in C++

And yet Chrome does it just fine, and Ladybird can render some websites properly that Servo cannot, curious.

No, Chrome doesn't eg. do style computation with a parallel algorithm like Firefox does since it adpoted Servo's style resolution engine. See how faster it is: https://nolanlawson.github.io/css-talk-2022/#70

Servo's rendering issues are a different class of bugs unrelated to performance: they are still working on the layout parts.

Eh that is a huge stretch. Besides Firefox is still significantly less performant than Chromium.
In what ways? I'm curious as I have been under the impression it's no longer much of a difference in the way it used to be.
Performance is overrated and irrevelant. It's simple force - not a skill. I can't do in more performat Firefox, neither it doesn't matter how performant Chromium, things that was possible in Firefox with old extensions. Not having such abilities, the only thing left to Google to talk about was.. performace - and crippling powers of Firefox. Rust is a new skill, not more of force.
Performance is overrated? What? I'm sorry but not all people are rich enough to own multiple threadrippers.

Performance is a skill, probably one of the most important skills.

Rust is a darn language, not a skill. You can have performant code in rust and in c++ and damnit even in brainfuck if you care enough.

But the reality is that there is more performance oriented code written in C++ than in rust, and that matters.

Another skill, inconvinient, forbidden and forgotten ( * * * that I wish Ladybird will have * * * ): plugins - so I have A Browser For All Documents that can play every video format regardless of web video codec support or licencing etc. (with vlc, mplayer, whatever).

Neither Javascript shall be needed to see anything on the Web - if not being essential for tracking and ads - but it's you who have to pay for it with that threadrippers (and no access to source data) ? Yes, it happend people are rich enough to belive that.

Making things simple and possible is the most important skill.

The discussion has nothing to do with the importance of a specific skill.
You can make a handmade car as well but it is difficult
How does that matter??
except they jettisoned the Servo project...