UniFFI (at Async JS meet up)

Tonight I was at Async for James talking about uniffi-rs. It’s a tool to generate bindings to Rust code from various other places: Javascript worlds, Python, Kotlin, Swift, others, and now—thanks to James—React Native too.

This one slide nicely shows the idea:

Uploaded image
James, left, and a slide showing a U shaped pattern: client on the left calls automatically generated code which lowers types to basic types, sends them over a foreign interface to Rust, which reads the lower types and raises them up to more friendly types, such as strings, enums and records (structs).

This is all new to me. It means you can:

  1. package up core logic and behaviour into Rust (nicely typed, safe, and well tested);
  2. package it, automatically via a build step; and
  3. call it at a high-level from iOS, Android, React (etc) application.

The talk will likely show up on the Youtube channel:

 https://www.youtube.com/@AsyncBrighton/featured