Looking to prevent memory bugs, the Android Open Source Project now supports the Rust language for development of the Android mobile OS itself, taking on development tasks that have been the domain of C/C++.
In a Google blog post on April 6, members of the Android team stressed that correctness of code in Android was a top priority for security, stability, and quality. Memory safety bugs are a top contributor to stability issues, representing about 70 percent of high-severity security vulnerabilities in Android; safety bugs in C and C++ continue to be the most difficult to address. Rust provides memory safety guarantees by leveraging compile-time checks to enforce object lifetime checks to ensure that memory accesses are valid, Android team members said. Further, Rust achieves this safety while providing performance equivalent to C and C++.