Coder Social home page Coder Social logo

bluegreenmagick / uniffi-rs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mozilla/uniffi-rs

0.0 1.0 0.0 10.89 MB

a multi-language bindings generator for rust

Home Page: https://mozilla.github.io/uniffi-rs/

License: Mozilla Public License 2.0

Rust 65.84% Kotlin 7.91% Python 8.43% Swift 6.71% C 0.19% Ruby 3.64% Shell 0.72% Makefile 0.12% WebIDL 6.44%

uniffi-rs's Introduction

UniFFI - a multi-language bindings generator for Rust

UniFFI is a toolkit for building cross-platform software components in Rust.

For the impatient, see the UniFFI user guide or the UniFFI examples.

By writing your core business logic in Rust and describing its interface in an "object model", you can use UniFFI to help you:

  • Compile your Rust code into a shared library for use on different target platforms.
  • Generate bindings to load and use the library from different target languages.

You can describe your object model in an interface definition file or by using proc-macros.

UniFFI is currently used extensively by Mozilla in Firefox mobile and desktop browsers; written once in Rust, auto-generated bindings allow that functionality to be called from both Kotlin (for Android apps) and Swift (for iOS apps). It also has a growing community of users shipping various cool things to many users.

UniFFI comes with support for Kotlin, Swift, Python and Ruby with 3rd party bindings available for C# and Golang. Additional foreign language bindings can be developed externally and we welcome contributions to list them here. See Third-party foreign language bindings.

User Guide

You can read more about using the tool in the UniFFI user guide.

We consider it ready for production use, but UniFFI is a long way from a 1.0 release with lots of internal work still going on. We try hard to avoid breaking simple consumers, but more advanced things might break as you upgrade over time.

Etymology and Pronunciation

ˈjuːnɪfaɪ. Pronounced to rhyme with "unify".

A portmanteau word that also puns with "unify", to signify the joining of one codebase accessed from many languages.

uni - [Latin ūni-, from ūnus, one] FFI - [Abbreviation, Foreign Function Interface]

Alternative tools

Other tools we know of which try and solve a similarly shaped problem are:

(Please open a PR if you think other tools should be listed!)

Third-party foreign language bindings

External resources

There are a few third-party resources that make it easier to work with UniFFI:

  • Plugin support for .udl files for the IDEA platform (uniffi-dl in the JetBrains marketplace). It provides syntax highlighting, code folding, code completion, reference resolution and navigation (among others features) for the UniFFI Definition Language (UDL).
  • cargo swift, a cargo plugin to build a Swift Package from Rust code. It provides an init command for setting up a UniFFI crate and a package command for building a Swift package from Rust code - without the need for additional configuration or build scripts.
  • Cargo NDK Gradle Plugin allows you to build Rust code using cargo-ndk, which generally makes Android library builds less painful.
  • uniffi-starter is a minimal project demonstrates a wide range of UniFFI in a complete project in a compact manner. It includes a full Android library build process, an XCFramework generation script, and example Swift package structure.

(Please open a PR if you think other resources should be listed!)

Contributing

If this tool sounds interesting to you, please help us develop it! You can:

Code of Conduct

This project is governed by Mozilla's Community Participation Guidelines.

uniffi-rs's People

Contributors

bendk avatar rfk avatar badboy avatar mhammond avatar jplatte avatar hywan avatar eoger avatar jhugman avatar bhearsum avatar linabutler avatar lonami avatar heinrich5991 avatar ijc avatar arg0d avatar sajjon avatar npars avatar saks avatar glandium avatar 0xomara avatar giarc3 avatar jmartinesp avatar mgeisler avatar skhamis avatar nesium avatar messense avatar ptitjes avatar bluegreenmagick avatar skeet70 avatar gmulhearn-anonyome avatar dmitry-borodin avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.