Live data from Hacker News

Shipping Rust code in Firefox

hacks.mozilla.org

101–110 of 197 posts

Re: Shipping Rust code in Firefox

#101

Earlier quoted context omitted.

The compiler has been fantastic emitting warnings about future language changes and I have appreciated it. The Rust compiler's messages (in general) are some of the highest quality I've seen, actually. The Rust Devs have done a superb job at documenting the changes. I'm more complaining that breaking changes to a non-beta language leave a bad taste in my mouth. Sure, they do have to happen sometimes, but it seems tha…

Cool, thanks. I mostly want to make sure we don't have any blind spots here; this is an issue we care about deeply. I think it's also important to remember that even languages which are known for "no breaking changes" do introduce breaking changes. Take Java for example, known for being an exemplar in this space. > However, implementation of some Java SE 8 features required changes that could > cause code that compil…

Thanks for the response! I'm excited to see what you all do with the errors:)

The UX of compilers have been improving dramatically lately...

Re: Shipping Rust code in Firefox

#102
post #64

AHHH Telemetry! I feel like there is a group of people who freak out to any form of telemetry, I just wanted to highlight them using it to track bugs. It's super beneficial to any form of changes, especially something like switching an entire language for a component.

I don't have a problem with telemetry, provided it is opt-in.

This makes telemetry effectively useless for developers though, unless a big intrusive "Click here to opt in" button is presented during startup. Nobody is going to enable it on their own accord.

Re: Shipping Rust code in Firefox

#103

Earlier quoted context omitted.

Where is the feature in GitHub that would show the languages used in a repository? That would be useful here regarding this comment. (Note I have no doubt you are right. It would just be a useful metric.)

Did they just..get rid of it? I can't find it either.

The C++ code is in servo/mozjs and servo/skia (though that dependency doesn't get used on a default run now IIRC), as well as some other scattered deps and native linkages (fontconfig, harfbuzz, openssl, etc)

We've split the code up in crates so servo/servo is only a fraction of the story. Things in servo/servo are usually components which don't make much sense as something you'd independently use, and are very servo-specific and/or tightly coupled. But a lot of our Rust code is outside the tree, and any C++ modules we use are too.

Also, he vast majority of code in servo/servo is actually HTML/JS test code, vendored in tree from w3c/web-platform-tests.

Re: Shipping Rust code in Firefox

#104

Earlier quoted context omitted.

Did they just..get rid of it? I can't find it either.

No, it works for other repostiories. Probably Github uses cloc. I downloaded the code (over 500MB, insane!) and cloc throws an error.

  > and cloc throws an error
tokei is a similar program that's parallel, and written in Rust. It takes 11 seconds to run on my machine, and shows

https://gist.github.com/steveklabnik/b4ede6f13c9d609edc61d74...

(using a gist since the output is huge, and see Manish's comment as well)

Re: Shipping Rust code in Firefox

#105

Earlier quoted context omitted.

> I wonder if Firefox will slowly become written in mostly Rust. I doubt that will ever happen. Small parts of Firefox, yes, but the browser is enormous. I think I once read that even Servo, which is a showcase for Rust, has more C/C++ code in it than Rust code, largely because it uses Firefox's JS engine.

> I think I once read that even Servo, which is a showcase for Rust, has more C/C++ code in it than Rust code Not in the core project: https://github.com/servo/servo

"core project" is a nebulous term. Stuff is in that repo when it doesn't make sense to break it off as a crate; and a lot of our code is broken off as a crate. But yes, the servo team rarely hacks directly on the C++ components. (we hack very often on Rust out of tree things though)

Re: Shipping Rust code in Firefox

#107

Earlier quoted context omitted.

No, it works for other repostiories. Probably Github uses cloc. I downloaded the code (over 500MB, insane!) and cloc throws an error.

> and cloc throws an error tokei is a similar program that's parallel, and written in Rust. It takes 11 seconds to run on my machine, and shows https://gist.github.com/steveklabnik/b4ede6f13c9d609edc61d74... (using a gist since the output is huge, and see Manish's comment as well)

This is including the cargo cache dir?

Re: Shipping Rust code in Firefox

#108

Earlier quoted context omitted.

I'm curious, do you have a language in mind that has been better than Rust as far as breaking changes go after the 1.0 stable release? An example? Rust has been far above most languages/libraries that I've found in dealing with breaking changes. The complaint here seems pretty empty to me. (Complaining for the sake of complaining)

Go has better backward compatibility.(i.e. no breaking change after 1.0)

Rust has the same policy.

It might appear differently because we're very up front about any change that might possibly break any code, even theoretically. We don't make any changes that we think actually break code, except for blatant bug fixes.

Go has made changes post-1.0 that were more aggressive than anything Rust has done, such as changing the size of int.

Re: Shipping Rust code in Firefox

#109
post #78

Earlier quoted context omitted.

SBT (scala) bootstraps itself in the same way. I think we're going to be seeing more of that going forward. For the produced binary packages (rpms, debs) it won't matter that much; although it will reduce build dependencies for source packages and give more consistent builds, even if your distribution comes with an _ancient_ version.

That's not a complete comparison though -- sbt only downloads the platform-independent jars and minuscule launcher scripts. It's still on the user to install a JRE globally. An analogue for rust would be something that detects the platform at runtime and then downloads a statically linked (?) binary that works on that platform. It can also exploit the ivy cache as the Scala compiler is just a library as far as SBT is…

Distros are okay with a single starting binary for compilers. Gcc does this, for example. Rust would publish a single bootstrap binary, and distros would build the next compiler with that (and publish), and build the next one with the one that they just built, and so on. Multiple platforms would just involve cross compiling the first time.

Re: Shipping Rust code in Firefox

#110

Am I'm reading either the headline or the announcement wrong? As I read it, they are not shipping Rust but a component written in Rust. > For this reason, Ralph Giles and Matthew Gregan built Mozilla’s first Rust > media parser. And I’m happy to report that their code will be the first > Rust component shipping in Firefox.

Was it inconceivable for you, after reading the article, to understand what they meant? Is it so shocking a headline that multiple people have commented that "well REALLY it's just compiled code from Rust, not the runtime/source code/etc.". Which one of those possible interpretations makes the most sense? It's just shocking to me this type of meta-discussion about the phrasing of an announcement headline is the bulk…

Don't underestimate just how easy it is to misunderstand phrases across cultures and languages.

It took me, literally, years before I figured out 'check your brain at the door'.

Post reply on HN