Hacker News new | ask | show | jobs
by seanmcdirmid 3047 days ago
What would be the point of having React Native for Rust if Rust itself is already native? Having a DOM API available in Rust?
1 comments

The goal would be a higher amount of code sharing and perhaps a more consistent way to organize data and logic across platforms.

React Native runs a JS VM in a separate thread and communicates to the native platform code (Java and objective c) to tell it where to draw things. The native code then passes things like touch events back to the JS thread.

I want to replace the JS thread with native code to hopefully increase performance and gain advantages from Rust such as its nice type system and the Cargo ecosystem.

I have a proof of concept running Tokio and Serde to talk back and forth on Android between Java and Rust but it doesn't do much yet. Needs a lot more time to get anything serious going.

That sounds super cool! I was looking into writing Rust bindings to Yoga myself but then saw your library. I'd love to read a post about what you're doing once you've made sufficient progress with it.
Yeah I should probably write a post to get more of the concrete ideas out there, I'm afraid I don't have enough time to work on it right now.

However, another contributor to my repo is doing some interesting work with Yoga here (though it's not quite related to cross-platform mobile apps):

https://github.com/victorporof?tab=repositories

I say "contributor" but he's basically the one doing the heavy lifting on the bindings lately