Hacker News new | ask | show | jobs
by tasuki 16 days ago
> We built our logic in Rust, so that compiles cross platform. It's really just the UI layer that is per platform.

Having never created a mobile app, how's that work exactly?

3 comments

We define our API into the Rust via protobufs[0] and some codegen.

The wrapper around these is very lean, FFI-based[1], it's abstracted to a library so Android devs never need to know there's rust/codegen involved.

We then define a light Kotlin-based wrapper around the protobuf-generated API[2]. This is a candidate to move to Kotlin multiplatform in the near future (mostly for test speed improvements).

[0] https://github.com/ankitects/anki/tree/main/proto

[1] https://github.com/ankidroid/Anki-Android-Backend/blob/a0428...

[2] https://github.com/ankidroid/Anki-Android/blob/68192585a7ae4...

FFI. For example in Flutter, there are packages like flutter_rust_bridge that allow you to write Rust that then interacts with the host OS.
Check out tauri.
Tauri is not even remotely an appropriate answer to this question.