5 ms·
Rust was pretty much designed to solve problems for Firefox. It's IMO the best bet Mozilla has made these last few years and we're just starting to see them rea
by kenhwang 9y ago
Rust was pretty much designed to solve problems for Firefox. It's IMO the best bet Mozilla has made these last few years and we're just starting to see them reaping the rewards.
- MBCook 9y agoIt was denintely a long term play. The worry i had was what if they get 80% down that road and find out it would t work for some reason (say they wouldn't be able to get performance high enough)? They’d have lost a TON of time and resources. Glad to see they got it to work.
- tmzt 9y agoI don't know how this relates to the creator of Rust or its actual origin story, but Mozilla has been trying to get many of the same results out of C++ for a long time. You can look at the evolution of smart pointers in the codebase, along with more formal ways of representing error return codes (borrowed from MS COM), and general good practices. It seems at some point they became aware of how unsuited C++ is for parallel processing, and how important it would be for browsers in the future. Even compartmentalization or running tabs in their own process is a form of parallelization. This requires an efficient way of sharing memory and preventing race conditions and errant writes, as well as a way to protect these processes from cross-site scripting attacks, buffer over- and underruns, etc. Computing hardware has also moved on from the CPU-centric world and the gains in battery life from dedicated GPU hardware being used even for rendering tasks, and now for font processing and other things were too good to pass up. I'm a long time follower of Mozilla's development, and extremely excited about what's happening with Firefox. (I'm also currently a Chrome user, leaving in large part due to profile corruption issues and inferior built-in development tools. I hope to be able to run Firefox and WebRender on both Ubuntu and Windows.)
- abiox 9y ago> (borrowed from MS COM) are you referring to microsoft's com (component object model)?
- tmzt 9y agoYes, though more to HRESULTS from the Windows API. This meant return values could indicate success or a specific error which could be determined with macros. Rust actually has a similar mechanism in its standard lib, the Result enum whuch resembles Maybe from Haskell, but has either a returned value if successful (which can be the empty object ()) or an Error. XPCOM was modeled on the Microsoft version using the same vtable tricks that it used to enable dynamic dispatch through interfaces.
- steveklabnik 9y agoSmall note, Option in Rust is Maybe in Haskell, Result in Rust is Either in Haskell.
- Turing_Machine 9y agoHow much Rust is actually in the new Firefox? I'm not seeing any based on a casual click-around in the repo, though I'll freely admit I haven't scanned the entire source tree. Edit: if there is any, can someone give me a link to the part of the source tree that has it?
- coffee-- 9y agothe FIDO U2F code is rust: http://searchfox.org/mozilla-central/source/dom/webauthn/u2f-hid-rs http://searchfox.org/mozilla-central/source/dom/webauthn/u2f... otherwise here's the list: http://searchfox.org/mozilla-central/search?q=&path=*.rs%24 http://searchfox.org/mozilla-central/search?q=&path=*.rs%24
- Turing_Machine 9y agoThanks.
- kenhwang 9y agoRead about the first bit of Rust shipping here: https://hacks.mozilla.org/2016/07/shipping-rust-in-firefox/ https://hacks.mozilla.org/2016/07/shipping-rust-in-firefox/ And many of the Rust things that make FF56+ fast can be found here: https://wiki.mozilla.org/Quantum https://wiki.mozilla.org/Quantum
- noncoml 9y agoGreat pointers, thanks. Do they also have any write-up on how did they find Rust during these changes? Was the back count lower than usual? Did the see an increase on productivity?
- 482794793792894 9y agoThese components were built as part of the Servo project and then ported to Firefox, so you'd probably just want to ask the Servo team directly. You can find them on IRC, in the channel #servo on irc.mozilla.org. There is https://blog.servo.org/ https://blog.servo.org/, but it's mostly gradual updates on things, not a general overview.