I am Niya (she/her). I am a programmer and a FOSS enthusiast. Servo is a web rendering engine written in Rust. I find Servo exciting, I think Servo is an important project and hopefully by the end of this post you will find Servo exciting too. I will also talk about Outreachy.
Why another Web Rendering Engine?
We already have other web rendering engines like Gecko (Firefox), Blink (Chromium), and WebKit (Safari). What makes Servo different from other major web rendering engines is that the development of Servo started in 2012.
If we talk about other web rendering engines, Blink was forked from WebKit, and WebKit itself was forked from KHTML. KHTML began in 1998. Gecko on the other hand, had its development start at Netscape in 1997.
The old times were different, computers were single threaded and slow. The first modern commercial implementation of simultaneous multi-threaded did not happen until 2002. The web rendering engines of those times were not architected with multithreading in mind.
A lot of really smart people work on web rendering engines, even then, it can take up to a few years to make architectural leaps because modern web rendering engine codebases are huge — millions of lines huge.
As an example, in his 2013 talk titled, “Servo: Designing and Implementing a Parallel Browser”, Jack Moffitt did a demo of using two parallel iframes, in Firefox (Gecko) and Servo. One of the iframes did computationally expensive matrix multiplications while the other one had a spinning Rust logo animation. Firefox froze and became unresponsive during the expensive computation, and the Rust logo's animation stopped while Servo remained responsive throughout, and the logo kept spinning.
Starting more than a decade after other web rendering engines helped Servo learn from the mistakes of its predecessors.
The features of Servo
Servo aims to be lightweight, highly concurrent and parallel, embeddable, and modular. I will break down what each of those means:
The Servo Book's architecture section gives a good overview of how Servo tries to be highly parallel and concurrent.
When Servo started as a research project at Mozilla, one of its goals was to swap out different parts of the web rendering engine. For example, if they want to experiment with a new layout engine, it should not require rearchitecting the whole codebase. The ability to swap these parts out is what makes Servo modular.
Web technologies today are not just limited to web browsers. For example, Node.js runs on the server. Similarly, a lot of efforts have been made to run applications made with web technology natively on the operating system. For example, Electron and Tauri. Servo aims to be a rendering engine that can be generally easily embedded. A use case of Servo might be letting developers make games with HTML, CSS, and JavaScript and embedding the game in a chat app. (Delta chat was at some point experimenting with Servo for this exact use).
Servo Community
Servo was created by Mozilla Research in 2012. Stewardship of Servo moved from Mozilla Research to the Linux Foundation in 2020, and then finally to Linux Foundation Europe in 2023 to help Servo gain interest from the broader industry.
As such, Servo has a diverse community. A lot of people working on Servo, including my Outreachy mentors and the community coordinator, are from Igalia. In 2019, Igalia is a major committer to both the WebKit and Chromium codebases. As such, Igalians bring a lot of expertise from other browser engines as well. I have also noticed people who have been working on Servo since it was at Mozilla Research. And others who are associated with OpenHarmony as well. I have lurked around the Servo's Zulip to learn about the community.
Servo is governed by the Technical Steering Committee (TSC), and the project follows a consensus seeking model. The TSC meets in public, and I recently joined one of the TSC meetings as well. I have read minutes of meetings for TSC before to better understand how the governance of the project works.
My motivation behind applying to Outreachy
I really like the idea of Free and Open Source Software. FOSS for me is about having the liberty to do what I want with software. It is about being able to study and understand what's happening under the hood. A huge advantage of open source software is that the community comes together, innovates, and contributes. It creates opportunities for people to learn.
I was also motivated by the AI policy of Outreachy as well as the organizations that participate. Maintainers play a crucial role in open source software, and the recent excess use of LLMs can thwart newer programmers from ever becoming competent maintainers. There are numerous other issues with LLMs that I won't cover here.
Outreachy also gives underrepresented minorities like me an opportunity to work with organizations that care about representation in tech. As a trans person living in India, I face a lot of challenges because of my identity. I find it important to integrate underrepresented minorities so that we find acceptance in tech and also serve as role models for other minorities.
My Project at Servo
I am implementing AudioWorklet in Servo. An AudioWorklet allows web developers to process Audio in a separate thread with very low latency.
The Web API can have many different uses, for example, a Bit Crusher effect processed natively in the browser.
I can imagine the AudioWorklet finding its use in video games or web apps that generate music.
First weeks of working on Servo
My first few weeks have been overwhelming, and it is completely natural. Servo is a large codebase and Rust is a hard programming language. I spent a lot (maybe too much) time learning Rust during this period. I also spent time reading the specifications that relate to AudioWorklet and Worklet.
Before starting my work on Servo, I knew enough Rust to navigate my way around the codebase and tackle most of the issues labelled e-less-complex (a tag for good first issues in Servo). The Servo community and Outreachy mentors helped me a lot with the contributions as well.
As I start my work on the AudioWorklet, I want to make sure I understand what I am doing, and be able to walk through anyone with all the lines of code that I commit.
I have managed to merge a PR that exposes static attributes of the WebIDL bindings for the PaintWorklet to JavaScript. It basically allows JavaScript to call methods related to the PaintWorklet with DOM APIs. I added a unit test for it as well to make sure the behavior doesn't break in the future. PaintWorklet is relevant here because the implementation share similarities with the AudioWorklet. Much of the work was done with the help of my mentors.
The Next Few Weeks
I plan to refactor the current Worklet implementation in Servo. The current implementation is based on PaintWorklet, they don't need to be stateful or long running. In contrast, an AudioWorklet is stateful and long-running. I will try to use Rust traits to generalize the implementation so the Worklet implementation can be used by both the PaintWorklet and the AudioWorklet.
Tags: #outreachy