<div dir="ltr"><div>There are obvious benefits to writing new things in Rust. In general, the main barrier to doing so is the extent to which they may interact with existing C++ code, and the adequacy of our tooling for managing that interaction.</div><div><br></div><div>In London last year, we had a meeting to discuss how we wanted to use Rust for DOM code. The consensus of that meeting was that Rust code could be useful as a backend for DOM functionality, but that it still needed to be wrapped inside a C++ shell to handle reflection, cycle collection, and interaction with the rest of the (C++-based) DOM.</div><div><br></div><div>Our tooling (specifically around bindgen) has matured significantly since then, largely to support stylo. But there are still a lot of unsolved use cases, and some of them (like inlining) are pretty hard to solve. The costs of haphazard integration can be high, specifically to performance, safety, and complexity/maintainability. So I think we want to tread carefully here.</div><div><br></div><div>In other words, I think we should encourage people to consider Rust for new code, but also make sure that we have a thoughtful and informed discussion about whether a use-case makes sense and how best to support it.</div><div><br></div><div>Right now we have a module that's intended to govern decisions on these issues [1]. However, the peer list for that module seems oriented around C++ and build system expertise, and is sparse on people who have been deeply involved in the Rust integration efforts over the past year.</div><div><br></div><div>So we could expand that group with expertise to tackle Rust integration issues. Or it could charter a committee  of such experts to do so. Or some combination. Either way, I think we want some amount of steering here, and I can think of a handful of names whose input is likely required to get it right.</div><div><br></div><div>Ehsan, as module owner, wdyt?</div><div>bholley<br></div><div><br></div><div>[1] <a href="https://wiki.mozilla.org/Modules/All#C.2B.2B.2FRust_usage.2C_tools.2C_and_style">https://wiki.mozilla.org/Modules/All#C.2B.2B.2FRust_usage.2C_tools.2C_and_style</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 10, 2017 at 3:29 AM, Nicholas Nethercote <span dir="ltr"><<a href="mailto:n.nethercote@gmail.com" target="_blank">n.nethercote@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Firefox now has multiple Rust components, and it's on track to get a bunch<br>
more. See <a href="https://wiki.mozilla.org/Oxidation" rel="noreferrer" target="_blank">https://wiki.mozilla.org/<wbr>Oxidation</a> for details.<br>
<br>
I think this is an excellent trend, and I've been thinking about how to<br>
accelerate it. Here's a provocative goal worth considering: "when writing a<br>
new compiled-code component, or majorly rewriting an existing one, Rust<br>
should be considered / preferred / mandated."<br>
<br>
What are the obstacles? Here are some that I've heard.<br>
<br>
- Lack of Rust expertise for both writing and reviewing code. We have some<br>
pockets of expertise, but these need to be expanded greatly. I've heard<br>
that there has been some Rust training in the Paris and Toronto offices.<br>
Would training in other offices (esp. MV and SF, given their size) be a<br>
good idea? What about remoties?<br>
<br>
- ARM/Android is not yet a Tier-1 platform for Rust. See<br>
<a href="https://forge.rust-lang.org/platform-support.html" rel="noreferrer" target="_blank">https://forge.rust-lang.org/<wbr>platform-support.html</a> and<br>
<a href="https://internals.rust-lang.org/t/arm-android-to-tier-1/5227" rel="noreferrer" target="_blank">https://internals.rust-lang.<wbr>org/t/arm-android-to-tier-1/<wbr>5227</a> for some<br>
details.<br>
<br>
- Interop with existing components can be difficult. IPDL codegen rust<br>
bindings could be a big help.<br>
<br>
- Compile times are high, especially for optimized builds.<br>
<br>
Anything else?<br>
<br>
Nick<br>
______________________________<wbr>_________________<br>
dev-platform mailing list<br>
<a href="mailto:dev-platform@lists.mozilla.org">dev-platform@lists.mozilla.org</a><br>
<a href="https://lists.mozilla.org/listinfo/dev-platform" rel="noreferrer" target="_blank">https://lists.mozilla.org/<wbr>listinfo/dev-platform</a><br>
</blockquote></div><br></div>