The Chromium team is exploring the Rust and C++ interoperability

The Chrome team also started to experiment with Rust. In the recently published document on Chromium official website, “Rust and C++ interoperability” was raised as an unsolved challenge.

At this stage, Chrome engineers know very well that C++ is the important programming language and will still be “the reigning monarch in our codebase” for the foreseeable future. They believe that if you use Rust, you need to adapt it to C++, instead of letting C++ work with Rust. What the Chrome team is currently exploring is whether and how Rust can call C++ code.

rust

From the current research results, the Chrome team has figured out several important ways to call C++ functions, including avoiding the use of “unsafe” keyword as much as possible, using libraries such as cxx to expand support, instantiating C++ objects, and safely passing ownership and many more. However, there are still many problems and difficulties to be solved.

In May of this year, Google engineers analyzed Chrome’s security vulnerabilities over the years and found that 70% of security vulnerabilities were memory security issues. So Google plans to try to explore some “safe” languages, and Rust is among them.
The Chrome team is still investigating and exploring Rust. They stated that if such interoperability is possible, they will consider the widespread use of Rust in Chrome and will “achieve this with robust production-quality solutions.”