Earlier quoted context omitted.
> Unless you are giving google your rust code to compile, your app will be limited on it's reach. Android has supported native code in apps for a long time via the Android NDK, mainly to enable game development. The Android team seems to hate the NDK, but the alternative is to have no games on the platform, so they can't simply kill it. > ...[native] ... It's not exactly great for runtime performance as it takes away…
Thankfully ART not only uses JIT, it also has an AOT compiler with PGO data shared across all devices in the ecosystem via the Play Store. In practice, people should learn how Android actually works.
Bare-metal Rust in Android
111–120 of 124 posts
Re: Bare-metal Rust in Android
#112Earlier quoted context omitted.
There's a reason Chrome is mostly written in C++. Android's JVM system is a collection of Java wrappers around C++ libraries. There's some overhead in that translation layer, and it's unfortunate that you can't skip it. Even Google's own Flutter uses a C++ engine to run Dart applications. Kotlin (and Java) is fast enough for many applications, but even with the recent advancements in ART, does have overhead compared…
> There's a reason Chrome is mostly written in C++ Yea, security is not a concern. Apparently.
Re: Bare-metal Rust in Android
#113I may have wrong assumptions, but I find it funny they didn't use Golang. Is it not capable of doing the same thing ? Anyway, happy to see rust being adopted for that usage.
Go is not a low-level language. They already have Java which sits at the exact same level.
Re: Bare-metal Rust in Android
#114Earlier quoted context omitted.
Go is not a low-level language. They already have Java which sits at the exact same level.
They have kotlin which can even compile to native binaries that run without a VM.
But no need for that, Android already does AOT.
Re: Bare-metal Rust in Android
#115Earlier quoted context omitted.
Thankfully ART not only uses JIT, it also has an AOT compiler with PGO data shared across all devices in the ecosystem via the Play Store. In practice, people should learn how Android actually works.
This just seems to prove my point that AOT is usually better than JIT?
JIT + AOT with PGO data shared across all Android devices on the planet, gets the best of both worlds.
Re: Bare-metal Rust in Android
#116Earlier quoted context omitted.
Can you please explain why Go isn't appropriate here?
Binary size, for one. The blog mentions a binary file grew from 220kb (C) to over 400kb (Rust). I also doubt a garbage-collected language work very well for drivers that require precise timing (MMIO) and/or control over memory allocation.
Re: Bare-metal Rust in Android
#117Earlier quoted context omitted.
Specifically a dialect called Firebloom (supposedly anyway) https://saaramar.github.io/iBoot_firebloom/
Firebloom is more of a custom compiler/toolchain than a dialect of C—apart from annotations to relate pointer+length parameters, etc., it is still just C.
Re: Bare-metal Rust in Android
#118Earlier quoted context omitted.
Can you please explain why Go isn't appropriate here?
Binary size, for one. The blog mentions a binary file grew from 220kb (C) to over 400kb (Rust). I also doubt a garbage-collected language work very well for drivers that require precise timing (MMIO) and/or control over memory allocation.
Re: Bare-metal Rust in Android
#119Earlier quoted context omitted.
Nope. Race conditions are an ordinary fact about our universe, Rust has those. (Safe) Rust doesn't have data races which are much stranger. Race conditions are just an ordinary effect where several actors are doing things and you need to be careful to ensure that they're co-ordinated properly if that's important. If Alice and Bob both conclude there's no milk, both then go to the store and buy milk, now there is too…
Speaking of race conditions, I recently looked into the current state of “make sure something is in the db and then retrieve it”. Absolutely bonkers that “on conflict do select” still doesn’t exist.