Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Interfacing with C from Rust is harder, and Rust has fewer cross-compile targets.

I'd expect Zig to be an easier deal here, with its zero-impedance interface with C.



> Interfacing with C from Rust is harder

Sure, harder, but not really all that difficult. Run bindgen over the NDK headers and see what happens. Sure, for ergonomics you'll want to write safe Rust wrappers. After that's done once, it's done.

> Rust has fewer cross-compile targets.

Not really an issue here. Rust supports all the targets Android runs on. Natively, even:

    $ rustup target list | grep android
    aarch64-linux-android
    arm-linux-androideabi
    armv7-linux-androideabi
    i686-linux-android
    thumbv7neon-linux-androideabi
    x86_64-linux-android


In my experience, C <-> Rust works quite well, except when the C API relies too much on macros.

C++ <-> Rust is much more annoying.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: