Servo Engines

What is Servo?

In 2012, Mozilla started the Servo project, a community effort to create new open source browser components that can take advantage of multicore hardware to improve speed, stability and responsiveness. Servo is comparable to WebKit, an open source browser engine that is the foundation of Apple’s Safari browser. (Other browser engines include Blink, EdgeHTML, and Gecko.) The difference is that Servo is written in the Rust programming language, bringing lightning-fast performance and memory safety to browser internals. Rust code can drastically cut down the number of critical bugs that affect browser engines. Servo uses a modular architecture and currently runs on Linux, macOS, Windows, and Android operating systems.

What components will Servo offer?

Like WebKit, the Servo project is not a complete browser. Rather, it offers a collection of components that can load, run, and display web sites and applications. These components include:

  • A parallelized CSS Style engine that can speed page load times and improve stability
  • A Paint engine, called WebRender, that moves drawing almost entirely to GPUs, ensuring high frame rates and freeing up the CPU to do other work
  • A Layout engine that uses new algorithms to process many parts of the page at once, instead of sequentially
  • A safer DOM that runs in parallel with other components of the system, helping ensure high security and buttery smooth performance.

Developers can integrate these web-friendly components into their own projects, including products, applications, user interfaces, and more.

How does it work?

Servo takes full advantage of Rust’s parallelization to bring multiprocess, multithreaded, GPU-accelerated browsing to today’s PCs, tablets, and smartphones. Servo code lets the browser run high-priority tasks in a thread that’s independent of the main thread. That means it’s less likely that unstable content or slow code will disrupt the browser’s critical functions.

Servo code is memory safe by default because it is written in Rust. The Rust ownership model helps the compiler ensure memory safety. It also makes writing parallel code safe and easy. With Rust, developers can safely reuse code to shorten development cycles. That gives Servo a low barrier to entry, allowing new programmers to make meaningful contributions to the code base without triggering costly, extended review cycles. Rust code can also shrink attack surfaces on applications, because it prevents common software faults such as “use after free” errors that hackers could exploit to gain access to the machine. Lastly, Rust’s memory safety can drastically reduce the time needed to complete peer reviews and QA.

Why does it matter?

Servo is very fast. Many parts are much faster than existing browser components written in C++. These gains in performance and reliability mean Servo engines can run modern applications with headroom to spare — and scale to new hardware such as virtual reality (VR) headsets.

Servo is simpler and easier to work with than legacy browser engines. That makes it a great base for new projects and experimentation. Servo promises to open up new use cases for web engines and allow more things to be built out of web technologies.

What does it replace or change?

We intend Servo to be a modern replacement for browser engines written in C++, often making them faster and safer. Servo also brings concurrency and robustness to the browser architecture, so it can support more complex and dynamic web applications in the future. Like WebKit, Servo can be easily embedded and used for a diverse set of use cases beyond just browsers.

What Web standards does it support?

Servo engines already support many web standards such as HTML, CSS, JavaScript, WebSockets, WebVR, and WebGL. However, we are still working on full web compatibility. Over time, we expect to support additional web standards such as WebRTC, WebAudio, Gamepad, and others.

Who is using it?

Mozilla is updating its Firefox Gecko rendering engine, over time, to incorporate technology from the Servo project. The Firefox Quantum release 57, available now, debuts the Servo CSS Style engine, previously called Stylo. A young technology, Servo may find future use as an enabler of enhanced VR experiences and as an embedded web engine in a range of new applications.