Live data from Hacker News

Shipping Rust code in Firefox

hacks.mozilla.org

161–170 of 197 posts

Re: Shipping Rust code in Firefox

#161

Earlier quoted context omitted.

It has a language definition. Neither Rust not Go have a formal semantics.

What's the equivalent of this[0] in Rust? [0] https://golang.org/ref/spec

https://doc.rust-lang.org/reference.html , which is accurate, but not always 100% up to date with the latest RFCs. There's also work on a formal, proven specification of the memory model, but that's not done. It'll be a while.

Re: Shipping Rust code in Firefox

#162

Earlier quoted context omitted.

Going the long way is just a 'proof of concept' sort of thing. You could design a high-performance JIT around equivalent safety mechanisms, and even prove the tricky parts.

JavaScript's memory model is incompatible with that of Rust anyhow. You would want something like typed assembly language (Google this--it's a fertile research area). Very researchy though, with uncertain payoff. But note that a lot of security problems are not in the jitcode but rather in C++ implementations of JS objects and in the compiler itself.

Typed assembly language would be an excellent addition to the Rust ecosystem -- there are still segments of software which should (or must) be implemented in assembly, so anything that can help make assembly easier to verify would be helpful to the ecosystem.

Re: Shipping Rust code in Firefox

#163
post #9
post #5

I'm curious why rust-url still hasn't been shipped with firefox yet. https://bugzilla.mozilla.org/show_bug.cgi?id=1151899

There are a couple of big pieces of work here: 1) Making the "cargo vendor" story work better. rust-url has a bunch of dependencies, and you have to get them all in-tree. 2) More security review & planning. URL parsing is scary! And we'd want to ship & run it alongside the C++ one to check for places where rust-url is not fully web compatible, but there are major privacy issues in reporting back anything more than "1…

Could a fuzzer that would report discrepancies between the C++ URL parser and rust-url help with part (2)?

Re: Shipping Rust code in Firefox

#164

Earlier quoted context omitted.

> You shouldn't need to test various versions of Rust if you there is a strong backward compatibility policy. Can you specify, in particular, what you think Rust is not doing that it should be doing?

I would like the code developed now to work with all subsequent rust releases until 2.0 so that I can take advantage of improvements to the compiler and std libraries without any additional effort. A small effort may effort may be required if there were security/critical bugs.

The Rust compiler is run against all the open-source crates published on crates.io to measure the impact of changes prior to release.

Re: Shipping Rust code in Firefox

#165

Earlier quoted context omitted.

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

If you're interested in the nitty gritty, there's some info in this PR: https://github.com/rust-lang/rust/pull/32756

Though Steve may be talking about some newer work that I haven't heard of yet.

Re: Shipping Rust code in Firefox

#166

Earlier quoted context omitted.

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

Between Rust's and Elm's error messages, Go's focus on compilation speed, and even GCC's improvements in diagnostics, I'm really enjoying this focus on developer UX I see. It's made me more UX-conscious in my own tools.

Re: Shipping Rust code in Firefox

#167
post #165

Earlier quoted context omitted.

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

If you're interested in the nitty gritty, there's some info in this PR: https://github.com/rust-lang/rust/pull/32756 Though Steve may be talking about some newer work that I haven't heard of yet.

There's also stuff like this: https://github.com/rust-lang/rust/pull/34789

In general, Jonathan and Niko are working on it :)

Re: Shipping Rust code in Firefox

#168
post #40

Earlier quoted context omitted.

If you click on the image to see the interactive graph, under "Advanced settings" there's a switch "Date range variable: filter submissions by build date range or submission date range", which is set to "build date range". So those "3 dates" correspond to three different build dates.

The telemetry link in the article points to Firefox 45 data. Curiously, the error rates appear to be going up: Firefox 46's error rate is 0.10% and Firefox 47's error rate is 4.35%. * Firefox 45: https://telemetry.mozilla.org/new-pipeline/dist.html#!measur... * Firefox 46: https://telemetry.mozilla.org/new-pipeline/dist.html#!measur... * Firefox 47: https://telemetry.mozilla.org/new-pipeline/dist.html#!measur...

Wouldn't that make sense because FF 46 was not an ESR, 47 is the latest, and most users have been pushed to 47? More users are triggering more bugs in the parser.

Also, 45 ESR doesn't include the Rust code on Windows (I heard that's landing in 48, if a Mozillian could please confirm that), so that's a large userbase to not have included in testing.

Re: Shipping Rust code in Firefox

#169

Are there other improvements besides the security advantages from this? E.g. performance or memory usage?

Performance can be considered a consequence of security/language safety. Rust code is free from data races and developers can utilize concurrency and all available CPU cores without fear.

As evidenced by Servo.

Re: Shipping Rust code in Firefox

#170

Even if Servo doesn't pan out as anything more than an experiment (though I'm optimistic that it will), I think Rust will bring real benefits to Firefox by enhancing security of isolated components like this mp4 parser.

> real benefits to Firefox by enhancing security of isolated components like this mp4 parser

Now if only there was a way to isolate stuff at runtime (i.e. a sandbox) to better take advantage of operating system mitigations. I hope that with e10s now (almost) shipping we will start to see some progress towards this. IIRC Mozilla has said they would start to roll out security features (related to e10s) in stages. I'll believe it when I see it but it's nice to finally see this from Firefox since it's been far too long without a defense in depth approach to security from them.

Post reply on HN