I currently develop for Android for a living and I’ve been interested in going onto iOS at some point. I recently saw the Dropbox presentation on sharing code between Android and iOS using a MVVM architecture and a binding generator called “Djinni”, and I’m curious if I can do something similar with Rust.
Why Rust? I’m a Java developer and I don’t have that much experience debugging native crashes and stuff like that, and Rust is interesting in that it gives a way to do native cross-platform development while also providing safety. Performance and tight integration with the platform is important to me, and Rust looks like it would be able to deliver. I could isolate the core code while still using best-practices native tools and languages for each platform’s front-end, which is something lacking from many of the professional tools out there.
Is anyone currently doing this? What is the state of the compilers and the tools? Is the language production-ready for mobile development? I checked out the Big Nerd Ranch tutorial on cross-compiling Rust for iOS and it was straightforward to get stuff compiling. However, I’m concerned as both Android and iOS are listed as “Tier 3” platforms in the official Rust intro, and there just doesn’t seem to be much in the way of official documentation. I’m worried about running into library bugs, or other snafus that might be obvious to a native developer but not so much to someone coming from Java development, for example stuff like passing the right flags to the compilers to avoid esoteric crashes because I screwed up the ABI calling convention.
My other concern would be tooling and debugging. Although there is less safety with C++ and C, Xcode comes with a bunch of great tools that would let me trace and debug issues directly.
My other alternative would be to wait and see what open-source Swift is going to look like, or just go ahead and build up an entirely new code base for iOS with Swift. That’s not entirely unreasonable as I’m going to have to write all-new code for the UI and platform-specific components anyways; on the other hand it also means increasing maintenance costs due to duplication going into the future, and it also means I miss out on learning a new language and putting it into practice. I’m just not sure where the balance lies with the tradeoffs in place, and if I’m exploring largely uncharted waters and what it means for these platforms to be “Tier 3” and if that’s going to change in the future.