5 ms·
OT I heard recently that rust isn't actually used in Firefox which of the original use case? What's the story there?
by bdjsiqoocwk 2y ago
OT I heard recently that rust isn't actually used in Firefox which of the original use case? What's the story there?
- heinrich5991 2y agoIt's used in Firefox. See e.g. the infobox of https://en.wikipedia.org/w/index.php?title=Firefox&oldid=1236706232 https://en.wikipedia.org/w/index.php?title=Firefox&oldid=123....
- littlestymaar 2y agoIdk where you got that info from because it is definitely. The CSS stack in Firefox was written in Rust in the context of Servo and then ported to Firefox.
- sampullman 2y agoThere's plenty of Rust in Firefox, see https://wiki.mozilla.org/Oxidation https://wiki.mozilla.org/Oxidation You might be thinking of Servo, which is a (purely?) Rust rendering engine that Mozilla abandoned, though it's not completely dead.
- rob74 2y agoIf you look at the actual LOC stats (https://docs.google.com/spreadsheets/d/1flUGg6Ut4bjtyWdyH_9emD9EAN01ljTAVft2S4Dq620/edit?gid=885787479#gid=885787479 https://docs.google.com/spreadsheets/d/1flUGg6Ut4bjtyWdyH_9e...), the rate at which the percentage of Rust code increases is pretty glacial: at the beginning of 2019 it was around 8%, mid 2020 (when the table ends) it got to ~ 12%. And today it's apparently at 11.4% (https://4e6.github.io/firefox-lang-stats/ https://4e6.github.io/firefox-lang-stats/) - although I'm not sure if this is an apples-to-apples comparison, as the table compared Rust vs. C/C++, while the pie chart includes all code - incl. HTML, JS etc. If I take just the Rust and C/C++ from the pie chart, Rust would be at ~ 22%.
- dralley 2y agoFirefox is something like 22 million lines of code, there's no way to make a dent in that at a pace that doesn't seem relatively glacial
- fhd2 2y agoNot an insider, but I can try: 1. I don't know if Rust is being used in Firefox today (edit: turns out it is, see my sibling comment), but I can imagine why they wouldn't: Mixing C++ and Rust is probably non-trivial with the kind of portability they're aiming for. A lot of the UI and "business" logic in Firefox is, and has pretty much always been, implemented in JS and XUL (which was also available to extensions before WebExtensions, which is why Firefox extensions could back then change almost anything about the browser). So with JS available for a lot of the logic, Rust is probably mainly interesting for replacing the lower level C++ parts. 2.Back when Rust was created, it was used in a project called Servo - a new browser engine. To my knowledge there were never concrete plans to switch Firefox over to that engine, but Firefox adopted a lot of the techniques they pioneered. Mozilla was a different organisation back then, happy to experiment with no clear path to revenue. I didn't find any of those developments too surprising. I'm definitely not surprised they don't undertake a major incremental rewrite these days where it's more about fast profitability.
- hobofan 2y agoRust is definitely used in Firefox, but Servo[0], which was going to be the replacement browser engine (or at least the testbed for that), was abandoned by Mozilla, in a limbo for some time and now under new stewardship. On a meta-level, I think the story that people like to tell is that Mozilla chose increasing executive compensation rather than using the same money to keep the Servo (and people working on Rust itself) employed. [0]: https://servo.org https://servo.org
- Liquid_Fire 2y agoFirefox is currently 11.4% Rust, according to https://4e6.github.io/firefox-lang-stats/ https://4e6.github.io/firefox-lang-stats/
- keybored 2y ago> OT I heard recently that rust isn't actually used in Firefox which of the original use case? Narrator: It wasn’t the original use case.