Hacker News new | past | comments | ask | show | jobs | submit login
Uniffi for React Native: Rust-Powered Turbo Modules (hacks.mozilla.org)
7 points by arctictony 4 months ago | hide | past | favorite | 3 comments



I've always thought that Rust and React Native would be a good match. Native extensions for React Native tend to be written either in platform specific code (or C++ which just isn't nice anywhere). Rust is approachable for developers coming from JavaScript (i.e. React Native developers) and works nicely cross-platform.

In my dream world, cross-platform modules which currently bridge separate Java/Kotlin (Android) and Swift/Obj-C (iOS) functionality into a single JavaScript API would instead bridge them into a single Rust API (which could then be bridged into JavaScript), which would allow cross-platform access to Android/iOS APIs from fast native code modules as well as from JS.


Javascript calling back and forth to Rust which calls in to Kotlin & Swift you say?

There are few pieces to put in place here, but it's something we've discussed.

The current task is teaching uniffi to support multiple foreign languages at the same time: <https://github.com/mozilla/uniffi-rs/issues/2295>.

But, yeah, what we're launching today takes you closer to your dream than it was yesterday. The rest, work is progressing.

What we're launching today is


"React Native apps rely on a single JavaScript thread, which can slow things down when handling complex tasks. Developers have traditionally worked around this by writing code twice – once for iOS and once for Android – or by using C++, which can be difficult to manage. Uniffi for React Native offers a better solution by enabling developers to offload heavy tasks to Rust, which is now easy to integrate with React Native."




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: