MITB Banner

Rust Users Rejoice! Chromium Adds Support For The Better C++

Last week, Google announced that the Chromium project would support the use of third-party Rust libraries for C++ going forward.
Share
Listen to this story

Last week, Google announced that the Chromium project would support the use of third-party Rust libraries for C++ going forward. This is part of their initiative to not only move away from using C++ in their toolchain, but also build out a comprehensive Rust toolchain upon which to build Chromium. This move is the first of many to enable the usage of Rust code in the Chromium binary from next year onwards. 

Bringing Rust into Chromium will net a host of benefits for developers in the Chrome ecosystem. Firstly, adding Rust will remove the need for an inter-process communication pipeline, which enables interaction between the various processes running in the browser. Secondly, the usage of Rust will promote more safety in the code, as it is safer in terms of memory management and has a lower propensity to induce application-breaking bugs. 

Chromium’s security will also be bolstered by Rust’s memory safety and reduced bug density. Moreover, using Rust will also enable the Chromium team to stick more closely with their Rule of Two. In addition to the added safety this will provide, bringing in Rust will also speed up their development process due to the reduction in the number of lines of code. 

The Rule of Two denotes that developers must not pick more than two of untrustworthy inputs, unsafe implementation languages (like C/C++) and high privileges. Any piece of code that has all three of these characteristics poses an extreme security risk to the project. 

However, as Chromium is an actively maintained product that multiple browsers are built on, the changes to their codebase must be carried out in a safe and measured way. The team has already tested Rust’s inter-compatibility with C++ through tools such as cxx, autocxx, bindgen, and more, and will slowly add Rust to their software stack as time goes on. Moreover, they have only added support for third-party libraries, adding any other C++ libraries on a case-by-case basis.

The team is also undertaking several measures to maintain compatibility, and are currently planning to support interoperability from one direction only, C++ to Rust. They aim to achieve this by building out a narrow interop API that can effectively communicate between C++ and Rust code, keeping in mind the differences between the two languages. This set of tools will enable the team to allow the two languages to ‘understand’ each others’ fundamental concepts. 

This move also follows the larger industry trend of switching away from C++ to improve memory safety. Microsoft has also begun to adopt Rust on their Azure platform for the same reason, with companies like Apple following suit to improve the industry standard for memory safety. These moves not only solidify Rust’s growing position as a C/C++ alternative, but also make the applications we use everyday safer and less buggy. 

PS: The story was written using a keyboard.
Share
Picture of Anirudh VK

Anirudh VK

I am an AI enthusiast and love keeping up with the latest events in the space. I love video games and pizza.
Related Posts

CORPORATE TRAINING PROGRAMS ON GENERATIVE AI

Generative AI Skilling for Enterprises

Our customized corporate training program on Generative AI provides a unique opportunity to empower, retain, and advance your talent.

Upcoming Large format Conference

May 30 and 31, 2024 | 📍 Bangalore, India

Download the easiest way to
stay informed

Subscribe to The Belamy: Our Weekly Newsletter

Biggest AI stories, delivered to your inbox every week.

AI Courses & Careers

Become a Certified Generative AI Engineer

AI Forum for India

Our Discord Community for AI Ecosystem, In collaboration with NVIDIA. 

Flagship Events

Rising 2024 | DE&I in Tech Summit

April 4 and 5, 2024 | 📍 Hilton Convention Center, Manyata Tech Park, Bangalore

MachineCon GCC Summit 2024

June 28 2024 | 📍Bangalore, India

MachineCon USA 2024

26 July 2024 | 583 Park Avenue, New York

Cypher India 2024

September 25-27, 2024 | 📍Bangalore, India

Cypher USA 2024

Nov 21-22 2024 | 📍Santa Clara Convention Center, California, USA

Data Engineering Summit 2024

May 30 and 31, 2024 | 📍 Bangalore, India