UniFFI is a multi-language bindings generator for Rust that enables developers to write core business logic once in Rust and automatically generate bindings for multiple target languages.
The tool solves the problem of maintaining separate implementations of the same functionality across different platforms and languages. It works by having developers describe their Rust component's interface either through an interface definition file or using proc-macros, then automatically generating the necessary bindings and shared libraries for different target platforms. This approach lets a single Rust codebase be compiled into shared libraries and called from multiple languages without manual binding maintenance.
UniFFI is well-suited for cross-platform projects where you want to write performance-critical or complex logic in Rust while exposing it to applications written in other languages. It works particularly well for mobile development, where you might need the same functionality on both Android and iOS. The tool currently supports Kotlin, Swift, Python, and Ruby as first-class targets, with third-party bindings available for C# and Go. The README mentions Diplomat as an alternative tool focused more on C and C++ interop, and Interoptopus as another similar solution, but does not provide detailed comparisons between them.
The project maintains active development with ongoing internal improvements and refinements to its architecture. The tool is used extensively in production by Mozilla across Firefox mobile and desktop browsers, where auto-generated bindings allow Rust functionality to be called from both Kotlin and Swift. The developers acknowledge that while the tool is ready for production use, it remains some distance from a 1.0 release, meaning advanced features may experience breaking changes as the project evolves, though simple consumers are prioritized for stability.