Reputation: 461
React Native recently introduced experimental support for Turbo Modules, which allow developers to write code in C++ and call it directly from Javascript.
Is it possible to write a Turbo Module in Rust instead of C++? Generally Rust has good interoperability with C / C++ so I expect it is possible, but I couldn't find any examples of it after searching Google, StackOverflow, GitHub, etc.
If it is possible, are there any downsides to doing so? Do you losing typing information for instance?
Upvotes: 5
Views: 1285
Reputation: 3067
You can use bridge between C++ and Rust https://cxx.rs/ Follow this thread to get an example of Rust integration https://twitter.com/_va_run/status/1493699146552803329
Upvotes: 2