5 ms·
Does anyone here have experience on using Rust for shared business logic between Android and iOS? It's something I'm considering but it seems there isn't a lot
by stefano 7y ago
Does anyone here have experience on using Rust for shared business logic between Android and iOS? It's something I'm considering but it seems there isn't a lot of documentation around it.
- j0hnnybravO 7y agoCurrently you could use kotlin/native for such effort.
- dbrgn 7y agoFor iOS, you create C FFI bindings for your lib. Then you conpile a universal binary with cargo-lipo and use it from Swift like a C library. For Android you write JNI bindings with something like rust-jni. So yes, you have to write bindings twice. For an example project check out https://github.com/dbrgn/candidateparser https://github.com/dbrgn/candidateparser and https://www.reddit.com/r/rust/comments/7aam04/meetup_slides_calling_rust_from_c_and_java/ https://www.reddit.com/r/rust/comments/7aam04/meetup_slides_...
- mncolinlee 7y agoYes, we're sharing Rust code through Kotlin on Android and Swift on iOS. https://github.com/mozilla/application-services/tree/master/components/places https://github.com/mozilla/application-services/tree/master/...
- gameswithgo 7y agothe game "A Snakes Tale" was released on IOS and Android simultaneously, 100% Rust. The author is on twitter might have useful info for you.
- kej 7y agoRust aside, this is a well done little puzzle game and worth the few bucks. It's on Steam, also.