28 ms·
I'm developing a game with React Native [1], and I have a single codebase that works on iOS, Android, Windows, and web (via react-native-web, although it needs
by nathan_f77 9y ago
I'm developing a game with React Native [1], and I have a single codebase that works on iOS, Android, Windows, and web (via react-native-web, although it needs a lot of work.)
I've had to write a few 'native modules' for various platforms, but it has to be platform-specific code anyway (e.g. ad networks, in-app purchases, game services)
I've been looking for a way to write some native code that I can compile to JS, and have decided to use C (or C++) with emscripten [2]. Rust or Kotlin might be fun, but I'm comfortable with C and it's easy to compile for iOS, Android (NDK), and Windows.
[1] https://sudoblock.com https://sudoblock.com
[2] http://kripken.github.io/emscripten-site/ http://kripken.github.io/emscripten-site/
- steveklabnik 9y agoRust should be just as easy to compile for those platforms. Using something you're comfortable with is good though!
- nathan_f77 9y agoYeah, that recent post [1] gave me a bit more confidence. Ooh, and it looks like I can compile Rust to wasm with emscripten! [2] I might have to reconsider Rust. [1] https://michaelfairley.com/blog/i-made-a-game-in-rust/ https://michaelfairley.com/blog/i-made-a-game-in-rust/ [2] https://users.rust-lang.org/t/compiling-to-the-web-with-rust-and-emscripten/7627 https://users.rust-lang.org/t/compiling-to-the-web-with-rust...