Live data from Hacker News

How Stylo Brought Rust and Servo to Firefox

bholley.net

61–70 of 199 posts

Re: How Stylo Brought Rust and Servo to Firefox

#62
post #47

> They borrowed Apple’s C++ compiler backend, which lets Rust match C++ in speed without reimplementing decades of platform-specific code generation optimizations. This was a pretty smart move by the Rust team, and this gave them a rock solid platform to go cross-platform. In words of Newton, "If I have seen further it is by standing on the shoulders of giants". Kudos team Rust, and let's hope they eat C++'s lunch so…

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

Apple doesn't "just use it". LLVM was originally developed at an university, then made production ready at Apple, and is still very much influenced by Apple, as Apple bases almost everything they make on it.

Re: How Stylo Brought Rust and Servo to Firefox

#63
post #47

> They borrowed Apple’s C++ compiler backend, which lets Rust match C++ in speed without reimplementing decades of platform-specific code generation optimizations. This was a pretty smart move by the Rust team, and this gave them a rock solid platform to go cross-platform. In words of Newton, "If I have seen further it is by standing on the shoulders of giants". Kudos team Rust, and let's hope they eat C++'s lunch so…

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

It's slightly oversimplified. Apple hired Chris Lattner from academia to ramp up work on LLVM & create Clang. (Apple always hated GNU stuff so the motive might not have been purely technical.)

Re: How Stylo Brought Rust and Servo to Firefox

#64

> 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…

It's certainly true that corporations do put a lot of work into languages and runtimes. Apple created LLVM and clang, Microsoft created .NET and CLR with C#, F#, VB.NET, etc.

These projects were valuable to Apple and Microsoft for a variety of reasons:

* promoting their IDE: XCode builds faster, and has better error messages. You can use any .NET language with Visual Studio in the same project.

* promoting their platform: Objective-C and Cocoa let you create fast GUI apps in a standard way, and we don't need GCC anymore. .NET provides a useful feature-complete standard library over a variety of languages.

To contrast, Rust was made with the intention of simply making a better systems language. Rust doesn't have a standard library or environment tied to a specific OS or proprietary dependencies. Rust itself doesn't promote Windows, OS X, ASP.NET, Cocoa, IOS, Android, etc. That is what makes it seem much less likely that rust would be created by a corporation.

Re: How Stylo Brought Rust and Servo to Firefox

#65
post #40

Earlier quoted context omitted.

Is there anything specific about Rust that you don’t think a commercial organisation would do? Obviously, commercial organisations have a long track record of developing and supporting programming languages.

Well, it's been in development for at least 7 years, without any product until the url parser appeared. That's far greater of an investment with no return than I've seen at any software enterprise outside of Google X, Microsoft Research, and Intel's various funding efforts, and each of those arguably have had more projects cut off before they return than they have had projects that succeeded in generating some return…

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.

Re: How Stylo Brought Rust and Servo to Firefox

#66
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?

Stylo is now enabled in Firefox for Android's Nightly builds. You can install Nightly from the Google Play Store to see if Stylo makes a difference for the animation problems. https://play.google.com/store/apps/details?id=org.mozilla.fe...

since when? I've been running Nightly for months.

Re: How Stylo Brought Rust and Servo to Firefox

#67
post #47

> They borrowed Apple’s C++ compiler backend, which lets Rust match C++ in speed without reimplementing decades of platform-specific code generation optimizations. This was a pretty smart move by the Rust team, and this gave them a rock solid platform to go cross-platform. In words of Newton, "If I have seen further it is by standing on the shoulders of giants". Kudos team Rust, and let's hope they eat C++'s lunch so…

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

LLVM started out as a research project at the University of Illinois, but Apple hired the lead developer in 2005 and put a ton of work into making it good enough to replace GCC. Apple also originally wrote Clang, LLVM's C/C++/Objective-C frontend, though Rust doesn't directly rely on this part.

Calling it "Apple's" threw me off too, but it's not entirely misleading because without Apple, it might not have become a production-ready compiler. At the least, I would say Apple did more than "just use it".

Re: How Stylo Brought Rust and Servo to Firefox

#68

One thing I've been wondering is that Stylo and Webrender can parallelize CSS and Paint, respectively, but I haven't seen any mention in Project Quantum (the project to integrate Servo components into Firefox/Gecko) of any component to parallelize layout, which is probably the biggest bottleneck on the web at the moment. Is parallel layout something which can only be done through a full rewrite, hence with Servo, and…

The OP links a video from 2015 that implies that one of the advantages of making Stylo the first Servo component in Gecko is that the next phase in the pipeline, layout, will be able to benefit from having a well-defined interface in place. I'm curious about this as well!

Re: How Stylo Brought Rust and Servo to Firefox

#69
post #40

Earlier quoted context omitted.

Well, it's been in development for at least 7 years, without any product until the url parser appeared. That's far greater of an investment with no return than I've seen at any software enterprise outside of Google X, Microsoft Research, and Intel's various funding efforts, and each of those arguably have had more projects cut off before they return than they have had projects that succeeded in generating some return…

> Well, it's been in development for at least 7 years, without any product until the url parser appeared. This is inaccurate, the URL parser never was and still isn't in a released Firefox. The first Rust in a released firefox was the mp4 metadata code. It's worth noting that in those 7 years Servo advanced a lot, which meant that the Stylo project didn't have to rewrite a style system, just take an existing one and…

Well, I'm certainly happy to admit my details are incorrect, but I think my broad point still stands—they look longer term than the typical commercial offering.

Re: How Stylo Brought Rust and Servo to Firefox

#70
post #65
post #40

Earlier quoted context omitted.

Well, it's been in development for at least 7 years, without any product until the url parser appeared. That's far greater of an investment with no return than I've seen at any software enterprise outside of Google X, Microsoft Research, and Intel's various funding efforts, and each of those arguably have had more projects cut off before they return than they have had projects that succeeded in generating some return…

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 relatively small organization.
Post reply on HN