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.)
are you referring to microsoft's com (component object model)?
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.
Glad to see they got it to work.
Edit: if there is any, can someone give me a link to the part of the source tree that has it?
otherwise here's the list: http://searchfox.org/mozilla-central/search?q=&path=*.rs%24
And many of the Rust things that make FF56+ fast can be found here: https://wiki.mozilla.org/Quantum
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?
There is https://blog.servo.org/, but it's mostly gradual updates on things, not a general overview.
- The URL parser (rust-url). This is not shipping, because it's incomplete and there are some mismatches to deal with. But it exists.
- Stylo: Servo's CSS engine in Firefox. By far the biggest one, this is shipping in beta and nightly, and should be there in the 57 release for everything but Android
- webrender: Servo's GPU-focused renderer. Not shipping, can be flipped on in nightly. Still has work to be done
- encoding-rs: All encoding operations go through this now. Shipping
- The U2F stuff: A lot of the U2F code is in Rust. Shipping in nightly though I think it's still off by default (but that will change soon?)
As far as the location of the code:
The root rust crate is at https://hg.mozilla.org/mozilla-central/file/tip/toolkit/libr... . Everything can be reached from it, and the cargo file that has all these links is https://hg.mozilla.org/mozilla-central/file/tip/toolkit/libr...
- All of Servo is vendored in tree in https://hg.mozilla.org/mozilla-central/file/tip/servo . Not all of Servo is used, the majority of the used code is from https://hg.mozilla.org/mozilla-central/file/tip/servo/compon...
- Webrender is vendored in tree in https://hg.mozilla.org/mozilla-central/file/tip/gfx/webrende...
- The U2F HID stuff is vendored at https://hg.mozilla.org/mozilla-central/file/tip/dom/webauthn...
- There's a bunch of stuff in libcubeb ; I don't even know what it's there for (https://hg.mozilla.org/mozilla-central/file/tip/media/libcub...)
- You can find "c api" rust crates scattered throughout, like mp4parse_capi, rust-url-capi, encoding_glue . These depend on the actual crate (usually, a crate that's published to crates.io) but expose an API that C can call into
- Finally, any dependency from crates.io is vendored in https://hg.mozilla.org/mozilla-central/file/tip/third_party/... . Note that this includes build time dependencies (so you'll find crates that deal with CLI parsing and terminal color info that aren't actually used by firefox). Despite the folder being labeled "third_party", a lot of that code is maintained by us, but in separate repos and published to crates.io. In particular, large chunks of Servo are reusable published crates.