Google's Android Open Source Project Now Supports Rust

Google is adding Rust as a new option for OS developers.

Recently, Google announced Android Open Source Project (AOSP) support for Rust.

Till now for app developers, Java and Kotlin have been popular options. And, for developers working on the OS and the lower levels within it, C and C++ have been popular choices. Now, support for Rust brings memory safety guarantees by using a blend of compile-time checks to carry out object lifetime/ownership, and runtime checks to warrant that memory accesses are valid. 

This safety is realized while offering equivalent performance to C and C++. Rust also reduces the need for sandboxing, giving programmers more overhead room to introduce new features that are safer and lighter on resources.

Source: Rust

Rust is known for focusing more on preventing bugs rather than the detection of bugs, resulting in enhanced correctness of code. The language has several key features, like memory safety, data concurrency, immutable references and variables by default,  more expressive type systems, better error handling in standard libraries, and much more.

Well, the switch to Rust changes nothing for app developer. It only affects how the OS is written. The company also does not have any plan to release a Rust NDK as of now. The supported languages for app development will continue to be Kotlin, C, Java and C++.

For the OS part also Google is focusing more on new Rust development rather than rewriting mature code. Since most memory bugs happen in new or recently modified code. The company will also share a few early adopter projects in the coming months, as scaling Rust to more parts of Android is a multi-year project.