Live data from Hacker News

Bare-metal Rust in Android

security.googleblog.com

21–30 of 124 posts

Re: Bare-metal Rust in Android

#23

Ok, now enable us to let create Android Applications entirely in Rust (including the GUI). Let's get rid of Kotlin/Java monopoly in Android App development. Shall we?

Tell me you've never done any Android development, without telling me... This is such a low-effort "take" without any effort to justify _why_ you'd want something like this. There's a high amount of impedance mismatch trying to write GUIs in a non-GC language like Rust which _has_ to run on what's essentially a Java VM (ART). At least with a language like Go, it somewhat makes sense, and has been attempted: https://g…

I didn't bash Java/Kotlin. In fact, I have written few android apps in Kotlin, Java and I also have fiddled with Jetpack compose, JNI and NDK (I have also played with mpv's Opengl/Vulkan's rendering on Android if that matters to you). I don't want to share the projects of mine because i don't want to reveal my identity.

> https://gioui.org/

I know that tailscale's android application is written in it but i don't think gioui is great for android apps.

> Tell me you've never done any Android development, without telling me...All this Java/Kotlin bashing is getting really old, especially for a forum like this one.

Ok, this one hurts. Why are you attacking me instead of defending your stance. All are allowed to have opinions and I am allowed to have one(It's sad to explain this to someone on forum like this one). I dream of Linux-desktop kinda situation where you can program in any language you want, where you are not hindered by any platform/framework, where you have complete freedom and where you don't want to be bothered/(vendor locked-in) by Bigcorps(looking at you Google services framework).

> write GUIs in a non-GC language like Rust which _has_ to run on what's essentially a Java VM (ART).

Haha, non-GC languages power the GUIs on Android fyi. Jetpack compose is powered by Skia. Chromium is powered by Skia. Skia is C++.

Please do your own research before commenting low-effort replies.

Re: Bare-metal Rust in Android

#24

Ok, now enable us to let create Android Applications entirely in Rust (including the GUI). Let's get rid of Kotlin/Java monopoly in Android App development. Shall we?

Tell me you've never done any Android development, without telling me... This is such a low-effort "take" without any effort to justify _why_ you'd want something like this. There's a high amount of impedance mismatch trying to write GUIs in a non-GC language like Rust which _has_ to run on what's essentially a Java VM (ART). At least with a language like Go, it somewhat makes sense, and has been attempted: https://g…

What does a GC have anything to do with it? You can reference count all the pointers if you want, you can expose JVM pointers in Rust where Rust doesn't manage the heap memory. There are plenty of easy solutions to work with the JVM

Re: Bare-metal Rust in Android

#25

Ok, now enable us to let create Android Applications entirely in Rust (including the GUI). Let's get rid of Kotlin/Java monopoly in Android App development. Shall we?

Tell me you've never done any Android development, without telling me... This is such a low-effort "take" without any effort to justify _why_ you'd want something like this. There's a high amount of impedance mismatch trying to write GUIs in a non-GC language like Rust which _has_ to run on what's essentially a Java VM (ART). At least with a language like Go, it somewhat makes sense, and has been attempted: https://g…

[dead]

Re: Bare-metal Rust in Android

#26
post #8
post #4

Earlier quoted context omitted.

Specifically a dialect called Firebloom (supposedly anyway) https://saaramar.github.io/iBoot_firebloom/

Possible related to the ‘-fbounds-safety’ feature they’ve proposed for Clang https://discourse.llvm.org/t/rfc-enforcing-bounds-safety-in-...

Firebloom == `-fbounds-safety`

Re: Bare-metal Rust in Android

#27

Ok, now enable us to let create Android Applications entirely in Rust (including the GUI). Let's get rid of Kotlin/Java monopoly in Android App development. Shall we?

Isn't this what Tauri wants to achieve? At least it's on the roadmap I mean. https://tauri.app/ Does anyone have any experience creating production apps with Tauri? Seems like a sane alternative to Electron, especially if they can target all major platforms and keep the promise of smaller footprints.

Not quite production, but I was on a paid contract on a PoC. I would say back at 1.0, mobile was pretty painful and signing of any binary dependencies was up to you. It looks like they addressed signing in 1.5 and I haven't picked it back up to check out the mobile experience.

Re: Bare-metal Rust in Android

#28
post #4
post #3

Earlier quoted context omitted.

I don't believe Apple has embraced Rust the same way Google has. Particularly their firmware is still very based on C.

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

#29
post #6

Earlier quoted context omitted.

What would rust achieve aside from just enabling another, entirely distinct from the existing workflow, language? Haven’t android apps been compiled to native code since like 2012? (I actually don’t know, I left android a while ago and stopped caring what they do)

I don't think it's a good idea, mainly because android is multiplatform and rust, by it's nature, is only available for what it's built for. Unless you are giving google your rust code to compile, your app will be limited on it's reach. All that said. Rust doesn't have a GC so it'd (likely) have a lower memory consumption and could possibly be lighter on the CPU. Native compilation helps mainly with startup time and…

VM warmup isn't consistently a thing, in fact for over a decade there has been plenty of observation of the reverse, that runtime optimization often slows performance. Systems languages (c/c++/rust) consistently outperform warmed up managed languages. And that is ok, it doesn't mean we shouldn't have managed languages, but they are slower.

Re: Bare-metal Rust in Android

#30
post #3
post #2

Is there similar effort from Apple?

I don't believe Apple has embraced Rust the same way Google has. Particularly their firmware is still very based on C.

The other commenter mentioning Firebloom is correct that some firmware (iBoot family) has been using C w/ Firebloom extensions for a while. Parts of SEPOS also use Swift, which would make more sense as a non-C language than Rust, from Apple's perspective at least.
Post reply on HN