Interop with Android, IOS and WASM in the same project
summary
A Rust library actually compiles to Android, iOS and Wasm and exposes concrete FFI: uses extern "C" and #[no_mangle], returns pointers with Box::into_raw and passes them to Java as JNI long-as-pointer, provides a C bridging header for iOS, and uses wasm-bindgen / wasm-pack to produce a .wasm plus JS wrapper. Core logic lives in a shared module, platform modules adapt signatures with cfg attributes, and pitfalls include pointer safety, callbacks, and Wasm export limits (no generics or lifetimes).
AI-written summary · about
chapters (10)
- 0:00Start
- 4:11Rust tools for FFI
- 14:24One more tool
- 16:18An idea
- 19:59Library's core logic
- 20:16WebAssembly Interface
- 21:52Standard FFI (iOS)
- 22:35Android Interface (JNI)
- 23:22Limitations
- 26:08References
related talks
30mRunning WASM in React Native apps
20mUsing Rust and WASM
39mSeamless Multiplatform – Kotlin-Rust-Multiplatform?!
30mWASM in the Wild West: A Practical Application Tale
33mC# and Wasm Interface Types: Hands Across the C
37mSharing Code between iOS & Android with Rust
45mInteraction with real-world JavaScript from compiled Rust
50mWeb Assembly
