Application developers can primarily opt for Java or Kotlin to build their applications, but the lower layers of the operating system itself need more robust and bug-proof alternatives, such as C or C +. +. Google has now announced the Rust support as a supported programming language in AOSP.
From now on, lower layers of Android will be able to combine C, C ++ and Rust, not very popular but very popular with those who use it. These languages are designed with control and predictability in mind, being better options for accessing low-level resources and hardware.
Android made with Rust
For a year and a half, Google gradually incorporating the Rust programming language in a number of AOSP projects, such as the new Bluetooth stack.
The main advantage of Rust over C and C ++ is that it has mechanisms to improve memory security by reducing the need to use Sandbox, which consumes more resources and introduces latency into the process. Google strengths Two direct benefits of using Rust in Android development– Reduces the density of errors in your code and reduces the need for sandboxing.
With tens of millions of lines of code in AOSP, rewriting everything in Rust would be a daunting and impractical task, so Google focus your efforts on using Rust in new developments and not by rewriting the old code. Additionally, according to Google research, it is precisely the relatively new projects that have the most memory security bugs, and that will benefit the most from using Rust.
With a multitude of outbuildings and tool chains that need to be maintained, tools and testing infrastructure to update, and developers who need training, Google is considering making Rust a bigger part of Android it’s a multi-year project. For now, Rust will coexist with C and C ++ in Android development itself. For app developers, there is no change.
More information | Android Developers



