5 ms·
There is a huge amount of potential for shared infrastructure for "native integrations" for Rust UI projects. Think: React Native modules but in Rust. I'm hopi
by nicoburns 10mo ago
There is a huge amount of potential for shared infrastructure for "native integrations" for Rust UI projects. Think: React Native modules but in Rust.
I'm hoping this can be a reality sooner rather than later. But we're definitely lacking in manpower willing or able to work on the more foundational pieces. Winit in particular is sadly undermaintained. 1 or 2 people working full time on Winit and/or other platform integration pieces would do wonders for the ecosystem.
- tonyhart7 10mo agoI mean cross platform is just "heavy work" in general many company literally just give up use web wrapper instead because its just so much work
- foresterre 10mo agoIf you do it via React Native turbo modules, it is already possible, either using craby (1) or using uniffi-bindgen-react-native (2). (1) https://github.com/leegeunhyeok/craby https://github.com/leegeunhyeok/craby (2) https://github.com/jhugman/uniffi-bindgen-react-native https://github.com/jhugman/uniffi-bindgen-react-native
- nicoburns 10mo agoMy understanding is that this only gives you access to C++ TurboModules? Binding to C++ is already easy in Rust (and odten Rust itself is a better choice for these "cross-platform business logic" kind of modules anyway). The value here is in unlocking bindings to the native platform APIs (which are mostly Java/Kotlin/Objc/Swift)
- rekireki 10mo agoI would love to see RustActivity in Android one day, this would make the life much easier.
- nicoburns 10mo agoThere is https://github.com/rust-mobile/android-view https://github.com/rust-mobile/android-view, although it's not currently being actively developed.
- rekireki 10mo agoI've seen it too recently, looks interesting.
- ycombinatrix 10mo agoNativeActivity is already a thing and can be implemented in Rust
- mdhb 10mo agoI have no idea why people would want to write UI in Rust when Swift, Kotlin and Dart are much better suited for the job.
- bbkane 10mo agoOne language vs 3 or 4? And some folks REALLY like Rust
- freedomben 10mo agoAt least for me: * I don't trust Swift on Android to be well supported, either now, or in the future. I would never want to rely on something Appley on a non Apple platform * I dislike Swift and find it to be an unpleasant language. This is personal pref of coures, just like preferred flavors of ice cream * Dart looks interesting and like a good option, though I don't want to learn a new language and Dart doesn't appeal to me because it feels like they took javascript and made it more like Java, and Java is in about the middle of my list of preferred langs (see above comment about preferred flavors of ice cream). Flutter is a killer app though and might be enough to sway me. * Kotlin is a nice language, though not nice enough to where I'd want to use it outside of Android. The ties to the JVM-world tooling/dependency management is very offputting to me. Overall I have a strong desire to use my preferred language(s) for everything if possible, so things like this are quite attractive to me for that reason. Now that said, when I write Android apps right now, what I typically use is Kotlin or Java because I've found I always end up having to write at least part of the app in those, so might as well keep it simple and consistent in one lang. But I'm always on the lookout!
- andrekandre 10mo ago> I dislike Swift and find it to be an unpleasant language. what do you find unpleasant about it?
- rekireki 10mo agoOne of the reasons for me personally is a rich selection of packages from crates.io. For example if you are writing a server in Rust, and use something like https://crates.io/crates/reqwest https://crates.io/crates/reqwest for http requests, then you can reuse it in your mobile app. Also there's serde. You don't need to write the schema for your data if you have Rust on both server and client. Just make a shared crate and use serde to encode/decode the data. It really saves a lot of time if you don't have to use swagger or similar tools. And there's a documentation out of the box with `cargo doc`