Google announced that the Android Open Source Project (AOSP) is adding support for Rust as a development language for the Android operating system. Support is added to help avoid memory security bugs in code.
Google advocates the use of managed languages such as Java and Kotlin as the best option for developing Android applications because they are designed for ease of use, portability, and security. Android Runtime (ART) manages memory on behalf of the developer.
Writing on Google’s new medium, Jeff Vander Stoep and Stephen Hines of the Android team said that
“Memory security bugs in C and C ++ continue to be the most difficult source of bug to resolve. We invest a lot of effort and resources in detecting, fixing, and mitigating this class of bugs, and these efforts are effective in preventing a large number of bugs from turning into Android versions. Yet despite these efforts, memory security bugs continue to be a major contributor to stability issues and consistently account for ~ 70% of Android’s high-severity security vulnerabilities.. “
In view of this, Google is redoubling its efforts to avoid memory bugs, and memory-safe languages are the best way to achieve this. With that in mind, Google is adding support for Rust to the existing supported languages.
The Android operating system makes extensive use of Java, effectively protecting large parts of the Android platform from memory bugs. The developers say that unfortunately for the lower layers of the operating system, Java and Kotlin are not an option. Instead, lower levels of the operating system need systems programming languages like C, C ++, and Rust, which are designed with control and predictability as goals, and provide access to system resources. and low-level hardware.
“They are light on resources and have more predictable performance characteristics. For C and C ++, the developer is responsible for managing memory lifetime. Unfortunately, it is easy to make mistakes while doing this, especially in complex and multithreaded code bases.. “
Rust avoids these errors by providing memory security guarantees by using a combination of compile time checks to enforce object lifetime / ownership and runtime checks to ensure that memory accesses are valid. . This security is obtained while offering performance equivalent to C and C ++.
Android Open Source Project
Android adopts Bazel for the build system
Android is Kotlin first
Kotlin – New Language for Android
To be informed of new articles on I Programmer, subscribe to our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.
or send your comment to: [email protected]