Ever-focused on advancing the Web, Mozilla's research arm has joined forces with Samsung to create a new browser engine based on a new programming language called Rust.
Mozilla Research is collaborating with Samsung to deliver an advanced technology Web browser engine called Servo that will take advantage of the faster, multi-core, heterogeneous computing architectures on the horizon. And Rust is the language Mozilla felt compelled to create purpose-built for the task.
"Servo is an attempt to rebuild the Web browser from the ground up on modern hardware, rethinking old assumptions along the way," Brendan Eich, CTO at Mozilla, wrote in an April 3 blog post. "This means addressing the causes of security vulnerabilities while designing a platform that can fully utilize the performance of tomorrow's massively parallel hardware to enable new and richer experiences on the Web. To those ends, Servo is written in Rust, a new, safe systems language developed by Mozilla along with a growing community of enthusiasts."
Mozilla and Samsung are bringing both the Rust programming language and Servo, the experimental Web browser engine, to Android and ARM, Eich said. This will enable them to further experiment with Servo on mobile. And Samsung has contributed an ARM back-end to Rust and the build infrastructure necessary to cross-compile to Android.
But why the need for yet another programming language? "Rust, is a systems language that is focused on speed, safety and concurrency," a Mozilla spokesperson told eWEEK. "Rust 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. Because Servo is designed from the ground up using Rust as its main implementation language, Servo will also tend to avoid sources of bugs and security vulnerabilities associated with incorrect memory management common to browsers implemented in unsafe languages such as C++, resulting in a faster, more secure experience for people browsing the Web."
Eich goes a bit further in his post:
"Rust, which today reached v0.6, has been in development for several years and is rapidly approaching stability. It is intended to fill many of the same niches that C++ has over the past decades, with efficient high-level, multi-paradigm abstractions, and offers precise control over hardware resources. But beyond that, it is *safe by default*, preventing entire classes of memory management errors that lead to crashes and security vulnerabilities. Rust also features lightweight concurrency primitives that make it easy for programmers to leverage the power of the many CPU cores available on current and future computing platforms."
According to the Rust language Website, "Rust is a curly-brace, block-structured expression language. It visually resembles the C language family, but differs significantly in syntactic and semantic details. Its design is oriented toward concerns of "programming in the large," that is, of creating and maintaining boundaries—both abstract and operational—that preserve large-system integrity, availability and concurrency. It supports a mixture of imperative procedural, concurrent actor, object-oriented and pure functional styles. Rust also supports generic programming and metaprogramming, in both static and dynamic styles."