

Everyone works mainly with their familiar tech stack.īetter separation of concerns / modularity.Ĭonsiderably more complicated to setup than monorepo (has to be done only once though).

The Rust binary is distributed as an external dependency.īetter for teams with different skillsets. Not ideal if there are team members unfamiliar with Rust. Rust is built as part of the app's build process. There are different ways to integrate Rust: As source (like in this repo) TODO move it to a folder android_app, like the iOS app. You even can reuse your core for a web-app, using WebAssembly, or desktop app (where again, you can use native or a cross-platform framework like Electron). For example, you can develop your MVP with Rust+React Native or Rust+Flutter, and migrate later to native iOS/Android, without having to rewrite everything. It's also very flexible, allowing to migrate easily between different platforms, including conventional cross-platform frameworks like Flutter or React Native. We keep a fully native UI experience and uncomplicated access to the latest APIs of the platforms. Rust, as a highly performant and safe language is a great fit for mobile. This approach gives us the best of all worlds: we prevent code duplication by using a shared library. If you want to help, just open an issue, or email me Why? This is an example that shows how to use a shared Rust core in native Android and iOS apps. This safety is achieved while providing equivalent performance to C and C++." In line with similar stats that Microsoft has published, Google's blog post says that "memory safety bugs continue to be a top contributor of stability issues, and consistently represent ~70% of Android’s high severity security vulnerabilities.Rust core for native Android and iOS apps Google lays out the benefits of Rust over C/C++, saying, "Rust provides 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. In the past, Google has typically used C or C++, but neither of these are memory-managed languages, and that opens Android up to memory leaks and buffer overflows. You can't write anything lower-level than ART in Java, since there would be no runtime environment to run it on. Further Reading Linus Torvalds weighs in on Rust language in the Linux kernelThe Android team does a ton of work pushing Kotlin and Java for app developers, but those languages rely on the Android Runtime (ART) in order to function.
