UniFFI
A multi-language bindings generator that exposes Rust code to Kotlin, Swift, Python, and Ruby.
Repository Health
Technical Analysis
UniFFI is a toolkit from Mozilla for building cross-platform software components in Rust. You write your core business logic once in Rust, describe its interface with an object model (via proc-macros or a UDL interface file), and UniFFI compiles the code into a shared library and auto-generates idiomatic bindings for multiple target languages.
UniFFI ships first-class support for Kotlin, Swift, Python, and Ruby, with third-party bindings available for C# and Go. It is used extensively inside Firefox to share a single Rust implementation across Android (Kotlin) and iOS (Swift) apps, and is considered production-ready.
What You Get
- Automatic generation of Kotlin, Swift, Python, and Ruby bindings from Rust code
- Two ways to describe your interface: proc-macros or a UDL definition file
- A generated FFI scaffolding layer that handles safe cross-language calls
- The
uniffi-bindgenCLI plus build helpers for integrating generation into your workflow
Common Use Cases
- Sharing one Rust implementation across Android (Kotlin) and iOS (Swift) apps
- Exposing a Rust library to Python or Ruby without hand-writing FFI glue
- Shipping cross-platform mobile components with a single core codebase
Under The Hood
Architecture - UniFFI is a Cargo workspace of cooperating crates: uniffi is the umbrella crate (with a cli module and lib.rs), uniffi_macros/uniffi_internal_macros provide the proc-macros, uniffi_udl/weedle2/uniffi_parse_rs parse the interface definitions, uniffi_meta models the interface metadata, uniffi_bindgen runs the code-generation pipeline (uniffi_pipeline), uniffi_core provides the runtime FFI primitives, and uniffi_build integrates generation into Cargo builds. Language backends emit Kotlin, Swift, Python, and Ruby.
Tech Stack - Rust (edition 2021) built with Cargo. Dependencies include anyhow for error handling, camino for UTF-8 paths, cargo_metadata for workspace introspection, and clap (color-free) for the bindgen CLI; templates drive the generated foreign code.
Code Quality - The project is mature and heavily tested, with dedicated fixtures/, bindgen-tests/, and examples/ trees exercising round-trip generation across languages, plus a maintained CHANGELOG and versioning policy documented in docs/. Strict inter-crate version pinning (=0.32.0) signals disciplined release management.
API Design - Consumers annotate Rust with ergonomic proc-macros or write a concise UDL file, then invoke uniffi-bindgen; the generated bindings are idiomatic in each target language. The learning curve is moderate given FFI concepts and build wiring, but the user guide and examples smooth onboarding.
Used by 3 apps in this directory
Anarlog
Note Taking · AI Assistants · Productivity
Anarlog is an open-source, local-first AI meeting notetaker that records, transcribes, and summarizes meetings entirely on your device — no cloud lock-in, no mandatory account, and every note saved as a plain markdown file you own forever.
Bramble
Password Manager · Security · Authentication
Local-first, end-to-end encrypted password manager that syncs your vault directly between your own devices over a private peer-to-peer mesh — no server, no account, no cloud in the middle.
mesh-llm
AI Development · AI Agents
Mesh LLM pools GPUs and memory across every machine you own into one OpenAI-compatible API, so agents tap distributed compute instead of a single GPU box or a metered cloud bill.