why is this big news weve had this stuff for decades now ?
Autogenerating Rust-JS Bindings with UniFFI
11–19 of 19 posts
Re: Autogenerating Rust-JS Bindings with UniFFI
#12Re: Autogenerating Rust-JS Bindings with UniFFI
#13Re: Autogenerating Rust-JS Bindings with UniFFI
#14PythonMonkey lets you arbitrarily execute JS code like:
``` import pythonmonkey pythonmonkey.eval("(() => { console.log('hi from js'); })()") ``` for reference.
Re: Autogenerating Rust-JS Bindings with UniFFI
#15Re: Autogenerating Rust-JS Bindings with UniFFI
#16Re: Autogenerating Rust-JS Bindings with UniFFI
#17Earlier 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.
Re: Autogenerating Rust-JS Bindings with UniFFI
#18Earlier quoted context omitted.
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.
Most of the details for doing this are over my head but wow what a nerd-snipe!
Re: Autogenerating Rust-JS Bindings with UniFFI
#19Earlier quoted context omitted.
We’ve had a library for generating JS bindings for Rust code for decades ?
Agreed, I doubt it's been a decade.. though maybe close-ish wasm-bindgen does something similar though, right?