Rust FFI

Open-source Rust projects categorized as FFI

Top 23 Rust FFI Projects

  • PyO3

    Rust bindings for the Python interpreter

    Project mention: no good UI toolkit/framework | | 2023-03-18

    I use Qt but I use PyO3 to set up a "Python/PyQt/PySide frontend on top of Rust backend" architecture for the QWidget APIs similar to the "QML frontend on top of C++ backend" that they officially promote for Qt Quick.

  • neon

    Rust bindings for writing safe and fast native Node.js modules. (by neon-bindings)

    Project mention: Interaction between a Node.js module and a Rust program | | 2023-01-31
  • SonarLint

    Clean code begins in your IDE with SonarLint. Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.

  • Rustler

    Safe Rust bridge for creating Erlang NIF functions

    Project mention: It's legos all the way down | | 2023-02-17

    unfortunately as of the time of this writing, rustler does not support generic type intefaces so I guess this is impossible?

  • rust-bindgen

    Automatically generates Rust FFI bindings to C (and some C++) libraries.

    Project mention: I implemented a NASA image compression algorithm | | 2023-03-23

    It looks like the guy you're replying too was kind of an ass, but I do want to point out for anyone else reading that that's not actually that much of a technical limitation: rust code can natively call C code. The main thing you need is a translation of the C library's header file so rustc knows what C functions and structs exist, and that can be automatically generated with bindgen.

  • flutter_rust_bridge

    High-level memory-safe binding generator for Flutter/Dart <-> Rust

    Project mention: no good UI toolkit/framework | | 2023-03-18
  • cbindgen

    A project for generating C bindings from Rust code

    Project mention: Rust FFI and cbindgen: Integrating Embedded Rust Code in C | | 2023-01-23

    Later we'll see what cbindgen essentially does is receive a configuration and a Rust library and then spit out a C header (.h) file. One might think that what cbindgen is doing might not be that special and can be done by hand. In which some cases that might be true if the project is simple enough. Though additionally as the cbindgen documentation states:

  • rust-cpython

    Rust <-> Python bindings

    Project mention: How does Rust Python ffi work? | | 2022-05-10

    I've never used pyo3, just cpython, but the latter at least let me do things like:

  • InfluxDB

    Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.

  • winapi-rs

    Rust bindings to Windows API

    Project mention: I seen people say that () is similar to void in C. But what is similar to void*? | | 2023-03-27

    The std library provides the type c_void for FFI, which is an enum with two variants. Some libraries have their own version, winapi for example defines c_void as an enum with no variants, making it identical to !. Finally, whenever the std needs a pointer with no particular type, they tend to reach for *const (), see ptr::to_raw_parts.

  • workers-rs

    Write Cloudflare Workers in 100% Rust via WebAssembly

    Project mention: How much Rust work is actually going on at Cloudflare? | | 2023-01-15

    I'm also in the Workers org but I have had a bit of interaction with Rust. There's some Rust in the Workers runtime using lol-html for HTMLRewriter as well as some tooling and there's the full blown workers-rs framework that I work on, but that's about it for the Rust I work on regularly.

  • jni-rs

    Rust bindings to the Java Native Interface — JNI

    Project mention: A system Steam should add | | 2022-12-10

    I do have education and real experience in the field. See, for example, my recent work on the rather arcane subject of Rust↔Java FFI. You don't get to pull rank with me, son. I know quite well what CreateFile does. (Fun fact: it creates a file handle, i.e. opens a file, and may or may not create the file itself.)

  • rust-cpp

    Embed C++ directly inside your rust code!

    Project mention: Zork++ reaches the v0.5.0, ...where the project has been [completely] rewritten in Rust | | 2023-02-13 <- not a transpiler, but almost as good

  • swift-bridge

    swift-bridge facilitates Rust and Swift interop.

    Project mention: swift-bridge 0.1.37 supports passing `Box&lt;dyn FnOnce(A, B) -&gt; C&gt;` from Rust to Swift | | 2022-09-15
  • magnus

    Ruby bindings for Rust. Write Ruby extension gems in Rust, or call Ruby from Rust.

    Project mention: Regarding using multiple languages in one project | | 2023-02-15

    You can also use Rust to write an extension module that can be loaded into the Ruby interpreter, so that everything runs in the same process:

  • j4rs

    Java for Rust

  • ext-php-rs

    Bindings for the Zend API to build PHP extensions natively in Rust.

    Project mention: OK so whose gonna tell them | | 2023-03-12

    Real chads write PHP websites and extend it with Rust

  • rust-objc

    Objective-C Runtime bindings and wrapper for Rust.

    Project mention: Where do I start for creating a windowed app in pure rust? | | 2022-11-22

    If you find dealing with the Obj-C bindings a bit daunting (I would), I'd recommend you use the objc crate. That will like you dive into the details of creating and updating Mac windows without having to figure out how to call Objective C from Rust.

  • curryrs

    Bridge the gap between Haskell and Rust

  • emacs-module-rs

    Rust binding and tools for Emacs's dynamic modules

  • winsafe

    Windows API and GUI in safe, idiomatic Rust.

    Project mention: A Proposal for Safe Window Handles | | 2023-03-25

    I don't know how rare this is (or how rare it should be), but this issue warned me about this potential problem, and I had to make a huge refactoring to treat the possibility. I had to rethink many aspects of all handle implementations. It was hard work, but in the end it was worth it.

  • robusta

    Easy interop between Rust and Java (by giovanniberti)

  • ocaml-rs

    OCaml extensions in Rust

  • mrusty

    mruby safe bindings for Rust

  • rusty-cheddar

    A Rust crate for automatically generating C header files from Rust source file.

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020). The latest post mention was on 2023-03-27.

Rust FFI related posts


What are some of the best open-source FFI projects in Rust? This list will help you:

Project Stars
1 PyO3 8,034
2 neon 7,089
3 Rustler 3,647
4 rust-bindgen 3,341
5 flutter_rust_bridge 2,449
6 cbindgen 1,758
7 rust-cpython 1,710
8 winapi-rs 1,621
9 workers-rs 1,536
10 jni-rs 844
11 rust-cpp 660
12 swift-bridge 485
13 magnus 404
14 j4rs 380
15 ext-php-rs 376
16 rust-objc 349
17 curryrs 296
18 emacs-module-rs 293
19 winsafe 256
20 robusta 239
21 ocaml-rs 211
22 mrusty 201
23 rusty-cheddar 190
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives