Live data from Hacker News

How Stylo Brought Rust and Servo to Firefox

bholley.net

91–100 of 199 posts

Re: How Stylo Brought Rust and Servo to Firefox

#91

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…

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.

> Is there anything specific about Rust that you don’t think a commercial organisation would do?

A good job. Most commercial PL efforts kind of suck. There are a small number of exceptions, and Rust is one of them.

Re: How Stylo Brought Rust and Servo to Firefox

#92

Earlier quoted context omitted.

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

> Apple created LLVM and clang To be specific, LLVM started as an academic project by Vikram Adve and Chris Lattner in 2000. Apple hired Chris Lattner in 2005 to work on LLVM for Apple. Clang, though, does appear to have been an Apple project, being introduced by Steve Naroff of Apple in 2007 as an open-source project.

Thanks for pointing that out.

LLVM is one of the main things Apple gets to claim credit for, yet they aren't the only ones who deserve it.

LLVM is one of the reasons rust is so great, and the world is better because of it.

Re: How Stylo Brought Rust and Servo to Firefox

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

In Joel's defense, we don't know that gecko is better than X years of incremental changes to Netscape 4.

One of the big issues with software engineering advice is that it is really hard to find apples-to-apples comparisons for outcomes.

Re: How Stylo Brought Rust and Servo to Firefox

#94

Earlier quoted context omitted.

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

Can anyone explain what a URL parser does and why it's so complex? I feel like there's a whole interesting story lurking there.

A URL parser takes a string with a URL in it, and returns some sort of data structure that represents the URL.

It's complex because URLs are complex; I believe this is the correct RFC: https://tools.ietf.org/html/rfc3986 It's 60 pages long.

(That said, page length is only a proxy for complexity, of course)

Re: How Stylo Brought Rust and Servo to Firefox

#95

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…

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

The environment in which Erlang was developed was very different from the environment today. There were no third-party 4GLs available targeting the niche that Ericsson wanted, and there are good reasons to not want to use C in a telephone exchange.

Re: How Stylo Brought Rust and Servo to Firefox

#96
post #93
post #83

Earlier quoted context omitted.

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…

In Joel's defense, we don't know that gecko is better than X years of incremental changes to Netscape 4. One of the big issues with software engineering advice is that it is really hard to find apples-to-apples comparisons for outcomes.

True.

I think we can say that Gecko ended up technically better than incremental changes to Internet Explorer, which I think was starting off from a more maintainable codebase than Netscape 4. That's hardly conclusive but it's some evidence.

Re: How Stylo Brought Rust and Servo to Firefox

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

Kind of OT, but I've noticed both latency and battery-life hits for compositing WMs in X (compared to traditional WMs).

Are those things being measured at all in FF? It may be that the tradeoff is worth it (and I have no doubt it can be done better than the median compositing WM on linux), but it would be good to have that data.

On the other hand, it may be moot if Wayland does end up taking over from X.

Re: How Stylo Brought Rust and Servo to Firefox

#98

I love Firefox Quantum and it has replaced Chrome as my browser at home. It's memory consumption is far lower with the same amount of tabs open. That said, why does it perform slower than Chrome on most benchmarks? Is it due to the Chrome team doing much more grunt work regarding parallelism and asynchronous I/O? Or are there still features in the current Firefox build that still call the original engine? Does Rust h…

> most benchmarks Which benchmarks are you talking about? It depends on what those benchmarks measure. For example, a lot of the Quantum work was in user-percieved UI latency; unless the benchmark is measuring that, and I imagine that's a hard thing to measure, it's not going to show up. > Does Rust have a runtime penalty as Golang does? Rust has the same amount of runtime as C does: very very little. https://github.…

Not sure if this is normal, but I have very noticeable lag in the search/address bar autocomplete which does make the whole browser feel a bit slow (MacOS Sierra, using Developer Edition).

And since we are here, the prompt/dialog windows in FF are still not native looking too. These are my two major complaints :)

Re: How Stylo Brought Rust and Servo to Firefox

#99

Earlier quoted context omitted.

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

Can anyone explain what a URL parser does and why it's so complex? I feel like there's a whole interesting story lurking there.

URLs have been a security issue for browsers in the past, and can get pretty hairy. From UTF-8 coded domain names to whatever you want to "urlencode". For example, you can encode whole images into URLs, for embedding them in CSS files.

Old IE versions had a hard URL length limit and were very picky with the characters in domain names, both limitations included as "security fixes" (which broke the standards).

Re: How Stylo Brought Rust and Servo to Firefox

#100

Earlier quoted context omitted.

Can anyone explain what a URL parser does and why it's so complex? I feel like there's a whole interesting story lurking there.

A URL parser takes a string with a URL in it, and returns some sort of data structure that represents the URL. It's complex because URLs are complex; I believe this is the correct RFC: https://tools.ietf.org/html/rfc3986 It's 60 pages long. (That said, page length is only a proxy for complexity, of course)

As someone who once tried to write code to do it to avoid pulling in a dependency.

Never again, it's not just that the spec is 60 pages long but that the actual behaviour out in the real world is miles away from the spec, the web is a complex place where standards are...rarely standard.

Post reply on HN