Live data from Hacker News

How Stylo Brought Rust and Servo to Firefox

bholley.net

41–50 of 199 posts

Re: How Stylo Brought Rust and Servo to Firefox

#41
post #39

What parts of FF 57 are written in Rust? Just Stylo? Edit: I don't intend for this to sound like I'm complaining, just interested.

Stylo is the biggest and most significant thing; there are some smaller bits (a media parser, and something else?) included before 57.

Re: How Stylo Brought Rust and Servo to Firefox

#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 because they're doing it incrementally. Kudos!

[1] https://www.joelonsoftware.com/2000/04/06/things-you-should-...

[2] https://www.joelonsoftware.com/2000/11/20/netscape-goes-bonk...

Re: How Stylo Brought Rust and Servo to Firefox

#43
post #39

What parts of FF 57 are written in Rust? Just Stylo? Edit: I don't intend for this to sound like I'm complaining, just interested.

Stylo is new in Firefox 57, but Mozilla has shipped other Rust code in earlier Firefox versions:

https://wiki.mozilla.org/Oxidation#Rust_components_in_Firefo...

Completed:

  MP4 metadata parser (Firefox 48)
  Replace uconv with encoding-rs (Firefox 56)
  U2F HID backend (Firefox 57)
In progress:

  URL parser
  WebM demuxer
  WebRender (from Servo)
  Audio remoting for Linux
  SDP parsing in WebRTC (aiming for Firefox 59)
  Linebreaking with xi-unicode
  Optimizing WebVM compiler backend: cretonne

Re: How Stylo Brought Rust and Servo to Firefox

#44

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

A classic example would be Erlang, which was developed at Ericsson for use in telephone exchanges.

Re: How Stylo Brought Rust and Servo to Firefox

#45
> For example, register allocation is a tedious process that bedeviled assembly programmers, whereas higher-level languages like C++ handle it automatically and get it right every single time.

Ideal register allocation is NP-complete, so a compiler can't get it right every single time.

I'm not sure how good in practice modern compilers are at this, but would be curious to know if there's some asm writers who can actually consistently outperform them.

Re: How Stylo Brought Rust and Servo to Firefox

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

In addition to this, Mozilla is hardly the size as Microsoft or Google. A more commercially focused version of Mozilla would probably have dedicated their resources elsewhere.

Re: How Stylo Brought Rust and Servo to Firefox

#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.

Re: How Stylo Brought Rust and Servo to Firefox

#48
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...

Re: How Stylo Brought Rust and Servo to Firefox

#49
post #45

> For example, register allocation is a tedious process that bedeviled assembly programmers, whereas higher-level languages like C++ handle it automatically and get it right every single time. Ideal register allocation is NP-complete, so a compiler can't get it right every single time. I'm not sure how good in practice modern compilers are at this, but would be curious to know if there's some asm writers who can actu…

I think "get it right" here is "have it work at all", not "get it fast".

Re: How Stylo Brought Rust and Servo to Firefox

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

> 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 polish it. (This is still a lot of work, but not as much)

Post reply on HN