Advertisement

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

Sign up for your weekly dose of what's up in emerging technology.

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.


Download our Mobile App



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. 

More Great AIM Stories

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

AIM Upcoming Events

Regular Passes expire on 3rd Mar

Conference, in-person (Bangalore)
Rising 2023 | Women in Tech Conference
16-17th Mar, 2023

Early Bird Passes expire on 17th Feb

Conference, in-person (Bangalore)
Data Engineering Summit (DES) 2023
27-28th Apr, 2023

Conference, Virtual
Deep Learning DevCon 2023
27 May, 2023

3 Ways to Join our Community

Telegram group

Discover special offers, top stories, upcoming events, and more.

Discord Server

Stay Connected with a larger ecosystem of data science and ML Professionals

Subscribe to our Daily newsletter

Get our daily awesome stories & videos in your inbox
AIM TOP STORIES

RIP Google Stadia: What went wrong?

Google has “deprioritised” the Stadia game streaming platform and wants to offer its Stadia technology to select partners in a new service called “Google Stream”.