4 ms·
There's still a bunch of build system issues to be solved before any Rust code can be included in Firefox. You can follow along at https://bugzilla.mozilla.org/
by nnethercote 11y ago
There's still a bunch of build system issues to be solved before any Rust code can be included in Firefox. You can follow along at https://bugzilla.mozilla.org/show_bug.cgi?id=1135640 https://bugzilla.mozilla.org/show_bug.cgi?id=1135640.
Note especially the two bugs listed in the "Blocks" field, which are the first two candidates for components to be rewritten once the build system issues are sorted out. (The second of these would replace the notoriously insecure libstagefright with a Rust alternative.)
Piston has a BMP decoder, and my understanding is that it is the one used by Servo. I looked at it briefly and I think its support for the dark corners of the BMP format would be even worse than Firefox's would be before my rewrite. See https://github.com/PistonDevelopers/image/tree/master/src/bmp https://github.com/PistonDevelopers/image/tree/master/src/bm... for the code.
- steveklabnik 11y agoThis is true, and we're actively working on those build system issues.
- pcwalton 11y ago> There's still a bunch of build system issues to be solved before any Rust code can be included in Firefox. You can follow along at https://bugzilla.mozilla.org/show_bug.cgi?id=1135640 https://bugzilla.mozilla.org/show_bug.cgi?id=1135640. It seems unfortunate to be maintaining two BMP decoders because of transient build system issues. Especially if we're going to have to rewrite Piston's, making us maintain three for a time. I understand if there was some pressing need to ship it now, of course, but other than that I think I would have preferred this be written in Rust as well. I guess it's not a big deal for 1,000 lines of code, though. We could probably do a line for line translation without much effort.
- nnethercote 11y agoI think Rust is great and I think having Rust code in Firefox will be great. But this is about more than just transient build system issues. If we want to completely replace C/C++ components with Rust components, rather than just having them co-exist, then we need to make Firefox have a hard dependency on Rust. I suspect I'm a lot more pessimistic than many people about when we can do that; to me it feels like something that is multiple years away. I'd be interested to hear how long you think it will take!
- pcwalton 11y agoI agree with you on the probable time frame here. I guess I had an implicit assumption—which may be wildly false—that maintaining the old BMP decoder wouldn't be too much of a burden. If it is a huge burden, then it would make sense to rewrite it now in C++. Otherwise, thinking long-term, I think it would make sense to rewrite in Rust, trading short-term bug fixes for improved memory safety in the future and less work overall (since you save one rewrite). (Again, though, since we're talking 1,000 lines of code of something that's probably line-for-line-translatable either way; I don't think it's a big deal.)
- metajack 11y agoThe current plan is to have Rust (in the form of rust-url replacing nsUrlParser) riding the trains later this quarter.