Google Supports Rust For Android OS Development
Written by Kay Ewbank   
Monday, 12 April 2021

Google has announced that the Android Open Source Project (AOSP) is adding support for Rust as a development language for the Android operating system. The support is being added to help avoid memory safety bugs in the code.

Google advocates the use of managed languages such as Java and Kotlin as the best option for Android app development, because they are designed for ease of use, portability, and safety. The Android Runtime (ART) manages memory on behalf of the developer.

androidlogo

Writing about the new support Google's Jeff Vander Stoep and Stephen Hines of the Android Team said that that

"memory safety bugs in C and C++ continue to be the most-difficult-to-address source of incorrectness. We invest a great deal of effort and resources into detecting, fixing, and mitigating this class of bugs, and these efforts are effective in preventing a large number of bugs from making it into Android releases. Yet in spite of these efforts, memory safety bugs continue to be a top contributor of stability issues, and consistently represent ~70% of Android’s high severity security vulnerabilities."

In view of this, Google is increasing efforts to prevent memory bugs, and memory-safe languages are the best way to achieve this. With this in mind, Google is adding support for Rust to the existing languages supported.

androidlang

The Android OS uses Java extensively, effectively protecting large portions of the Android platform from memory bugs. The developers say that unfortunately, for the lower layers of the OS, Java and Kotlin are not an option. Instead the 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 low level system resources and hardware.Stoep and Hines said:

"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's easy to make mistakes when doing this, especially in complex and multithreaded codebases."

Rust avoids these mistakes by providing memory safety 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 safety is achieved while providing equivalent performance to C and C++.

androidlogo

More Information

Android Open Source Project

Related Articles

Android Adopts Bazel For Build System

Android Is Kotlin First

Kotlin - New Language For Android

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Santa Is On His Way
24/12/2024

Around the world children are eagerly awaiting Santa - which is something of a problem since he'll only arrive when they are fast asleep. If you want to know when he'll arrive, track Santa's progress  [ ... ]



Meta Releases OpenSource Podcast Generating Tool
28/11/2024

Meta has released an open source project that can be used to automatically convert a PDF file into a podcast. Meta says Notebook Llama can be considered an open-source version of Google's NotebookLM.

 [ ... ]


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Monday, 12 April 2021 )