Earlier quoted context omitted.
Not having to use Java or any of its weird derivatives.
I implore you to try Kotlin; it’s a fantastic language and is a wonder to code in
Kotlin is just Java with extra steps.
31–40 of 124 posts
The Doom of programming languages? Rust must be run everywhere with no irony.
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?
You can technically create an Android app without any Java code. There are native APIs for graphics and input. However, as these are intended for games, you get a window into which you can draw... something. With OpenGL, for example. You don't get access to Android's regular UI framework. You will also have to go through the Java layer to do many things you might want to do — like requesting permissions or launching…
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…
Gio UI is an immediate-mode UI, and immediate-mode UIs map very nicely to Rust. egui is quite expressive and easy to use. https://www.egui.rs/
If you had pointed at something like GTK, then yes, there is a big impedance mismatch there.
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…
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 some key optimizations.
In theory a JIT might produce better runtime performance than AOT compiled code, but in practice that usually turns out as wishful thinking.
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?
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.
(fka Apache Cordova, fka PhoneGap)
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?
You can technically create an Android app without any Java code. There are native APIs for graphics and input. However, as these are intended for games, you get a window into which you can draw... something. With OpenGL, for example. You don't get access to Android's regular UI framework. You will also have to go through the Java layer to do many things you might want to do — like requesting permissions or launching…
Earlier quoted context omitted.
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…
>mainly because android is multiplatform and rust, by it's nature, is only available for what it's built for Android is one platform: android. I thought rust worked across multiple operating systems. >Rust doesn't have a GC so it'd (likely) have a lower memory consumption and could possibly be lighter on the CPU. So what? I have never used G.C. >Native compilation helps mainly with startup time and memory consumption…
Operating systems, not architectures. You'd have to cross-compile your application 4 times if you want to support all arms and x86s.
> I think the main benefit of rust/c++/ndk on android is that I can just port desktop programs and I don't have to learn android's java/kotlin and sdk.
It's not "just" port desktop programs. Android doesn't even use glibc.
Is there similar effort from Apple?
"CppNow 2023:Introducing a Memory-Safe Successor Language in Large C++ Code Bases"