News for hackers. Stuff that matters.
Re:Mozilla Webrender: rendering any webpage at several hundr... by robin_reala on Thursday February 25, 2016 @12:38PM (#11176081)
Mozilla have been developing a programming language called Rust for a while now. Two of the things it explicitly attempts to address are removing classes of potential memory bugs (like buffer overflows) and making it easier to write concurrent multicore programs. These two traits map nicely onto the browser landscape, as most devices have 2-8 cores now and memory bugs are a perennial problem.

To capitalise on this, and to give Rust a ‘halo’ project that uncovers potential issues early, Mozilla kicked off a project called Servo to research the ways that Rust could be used to produce a browser rendering engine. This has let them explore technologies like multicore rendering of a single page without dealing with the practical considerations (tried to find a nice way of putting it ) that Gecko has scattered throughout its codebase.

After Mozilla had made some progress Samsung became interested and started contributing a reasonable amount of code. I’m not sure if this is still happening, but you can see their interest given their prediliction for 8-core mobile CPUs.

Mozilla currently have no plans to replace Gecko with Servo outright, but they are folding Servo components back into Gecko when they’re portable and have obvious benefits. Gecko’s build chain can now handle Rust and I believe the URL parser is a port of Servo code (though I’m not sure it has landed yet). I think I recall a Mozilla engineer saying that Servo had progressed beyond a research project now, and it is pretty good at rendering reasonably complex sites, but they’ve still got a long way to go before it could be a drop-in replacement for Gecko.

Re:Mozilla Webrender: rendering any webpage at several hundr... by steveklabnik on Thursday February 25, 2016 @12:50PM (#11176171)
This is a great summary. Some very minor details that you didn't cover:

Rust and Servo were basically announced to the world at the same time, as "the Servo project." It was really important that we build Servo at the same time as Rust, to make sure that the language was actually useful at building a real practical thing. The experience of building Servo helped Rust's development immeasurably. Furthermore, it also helped Rust be built in Rust itself. There's a danger when you build a boot strapped compiler: you might make a language that's great for making compilers, but not much else. Servo made sure that wasn't true.

https://bugzilla.mozilla.org/show_bug.cgi?id=1135640 is the overall tracking bug for moving Rust stuff into Firefox. Firefox 45 on Mac and Linux will contain a teeny bit of Rust, and just got turned on for Windows a few days ago. It's an MP4 metadata parser. The URL parser has a patch, but it hasn't landed yet.

Re:Mozilla Webrender: rendering any webpage at several hundr... by cpeterso on Thursday February 25, 2016 @01:22PM (#11176463)
Gecko is also importing bits of Servo's CSS system: https://bugzil.la/stylo
Re:Mozilla Webrender: rendering any webpage at several hundr... by hobofan on Thursday February 25, 2016 @01:18PM (#11176419)
It should be mentioned that even though they started out as one project the Rust language team has done a great job at not letting the development of the language be influenced by the needs of the Servo project.
Re:Mozilla Webrender: rendering any webpage at several hundr... by tatterdemalion on Thursday February 25, 2016 @03:26PM (#11177527)
This is not at all true. The needs of Servo have had a huge impact on the development of the Rust language. The Rust team prioritizes feedback from Rust users, the largest of which (larger than rustc itself) is currently Servo.
Re:Mozilla Webrender: rendering any webpage at several hundr... by kibwen on Thursday February 25, 2016 @04:25PM (#11177920)
I believe what hobofan is implying is that the Rust developers have resisted bending the language solely to the needs of Servo, despite there originally being almost a 50/50 overlap between the Rust and Servo developers (nowadays the division is more clear, with pcwalton working full-time on Servo and brson working full-time on Rust).

The most notable example is the proposal variously known as "virtual structs" or "inheritance", which had a brief prototype implementation in Rust (circa 2013) solely to support Servo's needs (specifically regarding representing the DOM), but which met a wall of opposition from the community. Such a feature is still likely to appear sometime in the future (after all, if Servo needs it, then it's likely that others do too), but the Rust developers are taking their time to explore solutions that integrate the most cleanly with the rest of the language.

Re:Mozilla Webrender: rendering any webpage at several hundr... by steveklabnik on Thursday February 25, 2016 @04:23PM (#11177903)
It is true in some sense, we don't just implement things Servo wants. If Rust was beholden to Servo, we would have put inheritance in the language over a year ago, for example. That said, the eventual work for "something inheritance like" is absolutely predicated on Servo's needs. But we put it on the roadmap and weight it like anything else.

That said, we do take their needs into account rather highly, just like any project with a large upstream user.

Just like we wouldn't want Rust to be useful for only compilers, "only compilers and web rendering engines" isn't much better.

Re:Mozilla Webrender: rendering any webpage at several hundr... by clouddrover on Friday February 26, 2016 @02:19AM (#11180227)
Is there a plan to test the security benefits of writing Servo in Rust? Or, in other words, at what point will it be both practical and realistic for Servo to be tested in something like Pwn2Own?
Re:Mozilla Webrender: rendering any webpage at several hundr... by steveklabnik on Friday February 26, 2016 @11:49AM (#11182379)
Well, Pwn2Own is usually done with production-ready browsers, so I would assume Servo isn't eligible until it supports the whole web platform.

I'm not sure, as I'm on the Rust team, and not Servo; maybe someone who works on Servo directly knows better than I what plans are here.

Re:Mozilla Webrender: rendering any webpage at several hundr... by jbay on Thursday February 25, 2016 @12:57PM (#11176240)
This was an excellent summary explanation; thank you.