Autogenerating Rust-JS Bindings with UniFFI
hacks.mozilla.org
Autogenerating Rust-JS Bindings with UniFFI
1–10 of 19 posts
Re: Autogenerating Rust-JS Bindings with UniFFI
#2Re: Autogenerating Rust-JS Bindings with UniFFI
#3Could UniFFI be used to generate native modules to use rust with react native?
The web story with wasm already looks like it could eat away a big chunk of JS's share if WebIDL becomes a thing.
Re: Autogenerating Rust-JS Bindings with UniFFI
#4Re: Autogenerating Rust-JS Bindings with UniFFI
#5I'm not a rust dev, but this language is moving so fast into new territories that I'm more and more interested in picking it up. Could UniFFI be used to generate native modules to use rust with react native? The web story with wasm already looks like it could eat away a big chunk of JS's share if WebIDL becomes a thing.
Re: Autogenerating Rust-JS Bindings with UniFFI
#6I'm not a rust dev, but this language is moving so fast into new territories that I'm more and more interested in picking it up. Could UniFFI be used to generate native modules to use rust with react native? The web story with wasm already looks like it could eat away a big chunk of JS's share if WebIDL becomes a thing.
Yes, you can do that. UniFFI allows you to generate Kotlin and Swift wrappers, which you can wrap in a RN wrapper. We did this at work for a cross-platform mobile app, it's a bit of a headache to create because that are some subtleties with async or these kind of things, and they are handled differently in the UniFFI wrappers and RN wrapper, but for relatively simple libs I find it pretty convenient.
Re: Autogenerating Rust-JS Bindings with UniFFI
#7Re: Autogenerating Rust-JS Bindings with UniFFI
#8Re: Autogenerating Rust-JS Bindings with UniFFI
#9I'm not a rust dev, but this language is moving so fast into new territories that I'm more and more interested in picking it up. Could UniFFI be used to generate native modules to use rust with react native? The web story with wasm already looks like it could eat away a big chunk of JS's share if WebIDL becomes a thing.
Yes, you can do that. UniFFI allows you to generate Kotlin and Swift wrappers, which you can wrap in a RN wrapper. We did this at work for a cross-platform mobile app, it's a bit of a headache to create because that are some subtleties with async or these kind of things, and they are handled differently in the UniFFI wrappers and RN wrapper, but for relatively simple libs I find it pretty convenient.
Would be great if React Native team extend TurboModules to support generating Rust interop instead of just C++ - there are many truely cross platform rust modules (including support for iOS/android) than c++ and cargo makes much better developer experience than cmake.
Re: Autogenerating Rust-JS Bindings with UniFFI
#10Earlier quoted context omitted.
Yes, you can do that. UniFFI allows you to generate Kotlin and Swift wrappers, which you can wrap in a RN wrapper. We did this at work for a cross-platform mobile app, it's a bit of a headache to create because that are some subtleties with async or these kind of things, and they are handled differently in the UniFFI wrappers and RN wrapper, but for relatively simple libs I find it pretty convenient.
What would be really awesome would be a tool for generating JSI bindings to Rust code. Then you wouldn't need to go via Kotlin or Swift. I believe there are no technical barriers to such a tool. Someone just needs to implement it.