Google had two recent announcements of particular interest to Rust enthusiasts: ongoing efforts to introduce Rust into Android OS and the Linux kernel.

While a number of memory-safe languages like Java/Kotlin/go/et al. are used in user-space, the majority of OSes are written in C/C++ where incorrect memory usage is still a source of “high severity” bugs. The idea is that using Rust would avoid such classes of bugs and provide other benefits.

The Linux article has a few specific examples for a simple character device, ioctl handling, and synchronization primitives. They illustrate some of Rust’s advantages: immutability, static typing, lifetime checks, bounds checks, RAII, required initialization and error-handling, and so on. Most achieved at compile-time rather than run-time.

Why not bring C++ to Linux? Linus Torvalds had this to say:

LOL. C++ solves none of the C issues, and only makes things worse. It really is a crap language.

To be fair, C++ can solve some of C’s issues, but you generally have to go out of your way and use unsafe to anything dubious with Rust.