At first glance, this looks like an odd partnership: Mozilla just
announced that it has recently begun collaborating with Samsung on
Servo, its next generation browser engine. Mozilla Research started working on Servo as a
research project in 2012. The new browser engine, which is still far away from being available in any commercial project, is written in
Rust,
a relatively new programming language that is also being developed by
Mozilla Research. Together, Mozilla and Samsung are bringing both Rust
and Servo to
Android and the ARM architecture.
Samsung, a company spokesperson said, is interested in this project
because the company is “investigating various new technologies to
innovate legacy products. This collaboration will bring an opportunity
to open a new era of future web experience.”
Browser Engines In The Age Of Multicore Computing
As Mozilla’s CTO Brendan Eich told me yesterday, he believes that the
future of computing will inevitably involve parallel computing (and
he’s obviously not the only one). Mozilla’s research group started
looking at this from the perspective of the web and it’s clear that
today’s browser don’t make use of even the basic multicore processors
that most users now have in their computers, phones and tablets. Indeed,
as Eich noted, today’s web standards themselves make it hard to move
away from the sequential processing today’s browsers use to render pages
to effectively rendering webpages on multiple cores. The exceptions
right now are WebGL, which uses the graphics processor, and HTML5 Web
Workers, which bring a multi-threading approach to JavaScript.
As Eich stressed, however, just parallelizing one part of the browser and rendering pipeline
isn’t good enough.
Only a web engine “that’s parallelized deeply from end-to-end,” he told
me, will be able to fully take advantage of tomorrow’s processors with
16, 32 or even more cores.
Samsung, of course, is also working on bringing ever more powerful
multicore processors to its mobile phones, so a partnership with Mozilla
to make better use of these cores seems like a good fit. This
collaboration, however, will also surely raise some questions about
Samsung’s relationship with Google, given Chrome’s strong position as
the leading mobile browser on Android today.
Rust And Servo
That’s where Rust comes in (and Mozilla is
launching version 0.6 of the compiler and associated tools today).
Rust, which shares similarities with C++, Lisp, Erlang and a number of
other languages. The focus of Rust is on safety (especially when it
comes to memory management errors, something that’s often an issue with
C++) and concurrency. Rust, Mozilla says, “is an attempt to create a
modern language that can replace C++ for many uses while being less
prone to the types of errors that lead to crashes and security
vulnerabilities.” Later this year, once all the core libraries are in
place, Mozilla plans to launch Rust 1.0. Currently about five or six
people are working on the project at Mozilla and another ten to twenty
at Samsung.
The Future Of Gecko
With Gecko, Mozilla already has a pretty capable engine for its browser and
Firefox OS,
but the plan isn’t to completely replace Gecko with Servo at this
point. Instead, it seems more likely that Mozilla will use Servo as a
“new thing for new hardware,” Eich told me. Given the popularity of
Firefox, Mozilla can’t just push Gecko forward without breaking a lot of
things, but with Firefox OS, for example, the organization was able to
shed some of these constraints and introduce new features to its engine.
Servo, Eich believes, will teach Mozilla a lot that it can also use in
Gecko.