What if I told you that you could use the same very performant code in Android, iOS or even in Flutter. In this article, we’ll see how to achieve t...
For further actions, you may consider blocking this person and/or reporting abuse
Great article!
Flutter (Dart) has experimental FFI support that should allow to integrate Rust without the intermediate JNI step
You're right! Probably I'll dedicate a specific post for that. As it is experimental and the API can still change I thought it would be better to focus on a more stable way to integrate Rust with Flutter. Thanks for your insight! 😊
I was thinking the same thing, it's a shame that most of portability to flutter are just wraps around Android code,
While it's possible achieve the same in a cleaner and more efficient way
I love what Rust is doing in the multiplatform space (especially with Wasm). Thank you for highlighting more of what's possible.
Have you also looked into Kotlin Multiplatform? It can also output an iOS framework, and C library. On Android, it's nice because you can benchmark whether your code would work just fine in JVM-land (ART) or if you'd be better off compiling to native code and dealing with JNI overhead.
Jake Wharton gave a talk that broached this topic at Droidcon NYC 2019 droidcon.com/media-detail?video=36...
Rust may outperform compiled Kotlin code, but it's something to keep in mind.
Well done! I love seeing stuff like this. Rust is the perfect language for bridging all of these gaps, IMHO.
Very interesting indeed, well done! I wonder what are the setbacks you see on going multiplatform with rust? I have seen using non-conventional languages for writing once - running everywhere before and even though it looks cool, how maintainable is this in terms of finding developers willing to work with such project, third-party libraries, community... I see it as a cool experiment but not something you could do in a long run.
Hi Javier, I wouldn't certainly write a whole app using this approach, but for a very specific need in which you want to share code in the form of a native library I would. This, of course, would ultimately depend on the specifics of your team and your requirements. I don't think it would be a difficult task to find some devs interested in maintaining this part of the app. There's always someone willing to tackle this kind of complexities. The alternative in these kind of cases is having a dedicated team per platform, or do it in C++. Code duplication is costly, also in terms of possible bugs, and if you're willing to jump into C++... then why not use a safer programming language if possible.
As usual, there's not really a correct answer and it's ultimately you who have to decide, considering lots of factors, if it would be suitable for you or not.
Thank you for this interesting post. I'm currently developing apps with flutter and dart. Would i see a noticeable improvement on mobile in writing some code with rust instead of dart ? What are the real benefits here ?
The main objective of the article was to show that you could share the same code between different platforms, including Flutter. That being said, I guess it would only make sense to use Rust for a very intense process or calculation so you could leverage Rust's memory management and the ability to work in a parallel way without having to use isolates.
Helpful article! Thanks! If you are interested in this, you can also look at my article about Flutter templates. I made it easier for you and compared the free and paid Flutter templates. I'm sure you'll find something useful there, too. - dev.to/pablonax/free-vs-paid-flutt...
Great Read :)
I wonder what's really the benefit of using Rust compared to C(++) when you need to write unsafe code either way.
I was concerned about the same thing... Like, one of the biggest pros of Rust is the safety, so I don't particularly want to be writing apps with the unsafe keyword unless I really know what I'm doing (and most following along with this probably aren't expert Rust programmers who know how to write with the "unsafe" keyword safely)
Did i overread it or did you forget to mention that xcode is only available on a apple computer?
I didn't mention it as I thought it was obvious. But maybe I should in case some people don't know this. Thanks for your comment.
And for the web is wasm? And for the desktop can be native? Just starting learning rust and this is awesome i am so hype right now , thanks for sharing
Excellent article. I wonder if we can share a network layer this way between domains?
Fanastic article, rust is powerfull!!!
alternative: rust in flutter: rinf: github.com/cunarist/rinf
Great Article !
after read this , i think there is possibility to build an app for minning(crypto) on IOS and Android via Flutter .
Noice! How about adding Nativescript plugin too 🤓