Live data from Hacker News

How Stylo Brought Rust and Servo to Firefox

bholley.net

151–160 of 199 posts

Re: How Stylo Brought Rust and Servo to Firefox

#151
post #4
post #2

One thing I've noticed about Firefox, especially on mobile, is that transform animations are pretty janky. Does anyone know if this is being worked on? Should I submit a bug report?

Feel free to file a bug report with your hardware, Firefox version, and test case, yes. These often boil down to simple bugs (hardware-specific or page-specific) that can be quickly fixed when isolated. The medium-term effort to revamp the graphics stack is WebRender. Note that, like Stylo, WebRender is not just meant to achieve parity with other browsers. It's a different architecture entirely that is more similar t…

I am still a little sceptical of WebRender. Not for its theory or implementation, but relying on Graphics Drivers and GPU to do the work continue to be a pain. There are lots of Laptop with Graphics Drivers that doesn't ever get updated.

Re: How Stylo Brought Rust and Servo to Firefox

#152

Earlier quoted context omitted.

When I looked at browser.html, it was what you could call an "alpha-quality browser", unless we use different definitions of the term "alpha-quality".

We all due respect, browser.html can do so little that it's hardly more than a prototype. Also, Servo itself as a web engine is still far from supporting enough of the web stack to be usable in a daily browser. I guess putting effort in Stylo diverted some resources from Servo - I feel it didn't progress much the last year in terms of "sites I can browse for more than 5 minutes". At this point it's clear that Mozilla…

> are there any other pieces of Servo that can be useful

I definitely think Servo layout can be made useful. There have been no indications that parallel layout doesn't work in practice. Our performance tests have had good results, comparable to the results we saw in Stylo.

I would like to redo the way Servo layout scheduling works, possibly when async/await lands in Rust. I believe that will not only improve performance but also fix a whole bunch of random bugs relating to floats where our scheduler currently just does the wrong thing. (That doesn't mean we have to throw out all of that code or anything like that; it just means I'd like to redo how that works.)

Once you have layout, style, and graphics out of the way, what remains—really, at that point, the difference between Gecko and Servo, aside from embeddability—will mostly be DOM APIs and relatively isolated components such as image decoders. It's an open question how to use Servo DOM API implementations in Gecko. In any case, though, Servo's DOM story may change with the arrival of Alan Jeffrey's Josephine or something like it, and it probably makes sense to revisit this question once we decide how all of that will shake out.

And, personally, I don't know if you consider Pathfinder part of Servo or not, but I'm certainly aiming to get that in.

One thing's for sure: we won't be running out of things to do in Research any time soon. :)

Re: How Stylo Brought Rust and Servo to Firefox

#153
post #151
post #4

Earlier quoted context omitted.

Feel free to file a bug report with your hardware, Firefox version, and test case, yes. These often boil down to simple bugs (hardware-specific or page-specific) that can be quickly fixed when isolated. The medium-term effort to revamp the graphics stack is WebRender. Note that, like Stylo, WebRender is not just meant to achieve parity with other browsers. It's a different architecture entirely that is more similar t…

I am still a little sceptical of WebRender. Not for its theory or implementation, but relying on Graphics Drivers and GPU to do the work continue to be a pain. There are lots of Laptop with Graphics Drivers that doesn't ever get updated.

WebRender doesn't actually necessitate a GPU backend. You could have a CPU backend just as well.

(In fact, I might up being the one writing it.) ;)

Re: How Stylo Brought Rust and Servo to Firefox

#155
post #83
post #42

It's gratifying to see how successfully the same organization has learned from the debacle that was the rewrite from Netscape 4 to Mozilla in the first place. That time, they didn't release for years, losing market share and ceding the web to Internet Explorer for the next decade. Joel Spolsky wrote multiple articles[1][2] pointing out their folly. This time, their "multiple-moonshot effort" is paying off big-time be…

Joel is making two separate claims there, though he doesn't cleanly distinguish them. One is that rewriting from scratch is going to give you a worse result than incremental change from a technical point of view (the « absolutely no reason to believe that you are going to do a better job than you did the first time » bit). The second is that independent of the technical merits, rewriting from scratch will be a bad co…

I think there is something to be said for the technical & market advantage of “rewrites” in the sense of “very ambitious but still incremental refactorings”. Literally rewriting all the code from scratch is likely to be a mistake, but there’s a spectrum from “edit” through “refactoring” to “rewrite”, and it can pay to push toward the more aggressive end of that spectrum sometimes, if you know precisely what you’re doing.

That is, some of my projects (personal & professional) have benefited enormously from designating the old version as a “prototype”, creating a “new” project with slightly different architectural decisions based on the deficiencies of the old version, copying most of the code from the old version to the new, and filling in the details.

Re: How Stylo Brought Rust and Servo to Firefox

#156

> Stylo was the culmination of a near-decade of R&D, a multiple-moonshot effort to build a better browser by building a better language. This is the most impressive, and useful aspect of all the recent work in Firefox. Rust is an amazing language. It really brings something new to the table with its borrow checker. The fact that rust was created as part of a greater effort to work on a web browser is amazing.

What I wonder, and I do not mean this in negative way, is whether this would have happened in a more commercially oriented organisation. Mozilla remains a foundation, and I consider Rust a fruit of their labour in itself. To put it another way, I find it hard to justify developing Rust just for a web browser. But if you consider it from the perspective of a foundation developing tools for the developer community as a…

Languages (parsers and interpreters) aren't that hard to design. People do it for fun (e.g. Brainfuck or Whitespace). Good compilers are much harder.

Re: How Stylo Brought Rust and Servo to Firefox

#157
post #70
post #65

Earlier quoted context omitted.

This is pretty much just the purview of R&D departments in general, which includes Mozilla Research. It's just a happy coincidence that, thanks to open source, software companies are relatively incentivized to share their projects with the public rather than keeping them proprietary, which is the default tack for R&D units in other industries.

Well, I'm not even necessarily trying to soap box here about open source or free software per se—I do think commercial/proprietary research has value to society as a whole, albeit less value. For instance, take Big Table—enormously influential and, I think, beneficial to society in spite of being largely closed off to the public. However, rust is way better for everyone, and I find it shocking it came from such a rel…

It doesn't really matter that Mozilla's a small organization. All they had to do was provide strong leadership and management expertise, and entice the open source community to voluntarily join and advance the project accordingly. Which thereby lead to not just Mozilla, but a few other organizations joining in with developers of their own to collaborate together amongst each other, including an army of rogue volunteers that aren't backed by any organizations. That's just not something you'll ever see from a corporation that has to answer to greedy shareholders that only care about ROI figures, especially short-term ROI figures.

Re: How Stylo Brought Rust and Servo to Firefox

#158

Earlier quoted context omitted.

What I wonder, and I do not mean this in negative way, is whether this would have happened in a more commercially oriented organisation. Mozilla remains a foundation, and I consider Rust a fruit of their labour in itself. To put it another way, I find it hard to justify developing Rust just for a web browser. But if you consider it from the perspective of a foundation developing tools for the developer community as a…

Languages (parsers and interpreters) aren't that hard to design. People do it for fun (e.g. Brainfuck or Whitespace). Good compilers are much harder.

Rusts borrow checker, ownership and whole model is quite complicated actually. Remember we are going for a complete, sound model without holes.

There have been soundness bugs during development and I think we have some really amazing people behind the core language that have been able to refine and adapt rust as it grows.

Re: How Stylo Brought Rust and Servo to Firefox

#159
post #151

Earlier quoted context omitted.

I am still a little sceptical of WebRender. Not for its theory or implementation, but relying on Graphics Drivers and GPU to do the work continue to be a pain. There are lots of Laptop with Graphics Drivers that doesn't ever get updated.

WebRender doesn't actually necessitate a GPU backend. You could have a CPU backend just as well. (In fact, I might up being the one writing it.) ;)

>WebRender doesn't actually necessitate a GPU backend.

Wow to me this is big news! I have long wanted the GFX part to be CPU backend instead of the trend of Hardware Acceleration on GPU.

Cant wait to see the results.

Re: How Stylo Brought Rust and Servo to Firefox

#160
post #47

Earlier quoted context omitted.

Does this just mean LLVM? Because it's weird to describe it as "Apple's", Apple just uses it.

> it's weird to describe [LLVM] as "Apple's" It's equally weird to describe Android as "Google's".

Are you being sarcastic? Because Android is very much Google's. Is there anyone else who has anywhere close to as much influence on the development of Android as Google has? Android is for the most part being developed behind closed doors at Google. About once a year they lob over a bunch of new code over the fence, and everyone else gets to develop from there.
Post reply on HN