Rust FFI

Open-source Rust projects categorized as FFI

Top 23 Rust FFI Projects

  1. PyO3

    Rust bindings for the Python interpreter

    Project mention: Show HN: Robyn – "Batman Inspired" Python Web Framework Built with Rust | news.ycombinator.com | 2025-03-01
  2. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  3. rust-bindgen

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

    Project mention: Ask HN: What less-popular systems programming language are you using? | news.ycombinator.com | 2025-03-01

    You only hand-write function bindings in simple or well-constrained cases.

    In general, the expectation is that you will use bindgen [0].

    It's a very easy process:

    1. Create a `build.rs` file in your Rust project, which defines pre-build actions. Use it to call bindgen on whatever headers you want to import, and optionally to define library linkage. This file is very simple and mainly boilerplate. [1]

    2. Import your bindgen-generated header as a module and... just use it. [2]

    You can also skip step 1: bindgen is also a CLI tool, so if your C target is stable, you can just run bindgen once to generate the Rust interface module and move that right into your crate.

    [0]: https://rust-lang.github.io/rust-bindgen/

    [1]: https://rust-lang.github.io/rust-bindgen/tutorial-3.html

    [2]: https://github.com/Charles-Schleich/Rust-Bindgen-Example/blo...

  4. Rustler

    Safe Rust bridge for creating Erlang NIF functions

    Project mention: Pulumi Gestalt 0.0.1 released | dev.to | 2025-03-10

    Rust (for languages such as Erlang or Dart)

  5. workers-rs

    Write Cloudflare Workers in 100% Rust via WebAssembly

    Project mention: Python Cloudflare Workers | news.ycombinator.com | 2024-04-02

    - The speed of the Python interpreter running in WebAssembly

    Today, Python cold starts are slower than cold starts for a JavaScript Worker of equivalent size. A basic "Hello World" Worker written in JavaScript has a near zero cold start time, while a Python Worker has a cold start under 1 second.

    That's because we still need to load Pyodide into your Worker on-demand when a request comes in. The blog post describes what we're working on to reduce this — making Pyodide already available upfront.

    Once a Python Worker has gone through a cold start though, the differences are more on the margins — maybe a handful milliseconds, depending on what happens during the request.

    - There is a slight cost (think — microseconds not milliseconds) to crossing the "bridge" between JavaScript and WebAssembly — for example, by performing I/O or async operations. This difference tends to be minimal — generally something measured in microseconds not milliseconds. People with performance sensitive Workers already write them in Rust https://github.com/cloudflare/workers-rs, which also relies on bridging between JavaScript and WebAssembly.

    - The Python interpreter that Pyodide provides, that runs in WebAssembly, isn't as fast as the years and years of optimization that have gone into making JavaScript fast in V8. But it's still relatively early days for Pyodide, compared to the JS engine in V8 — there are parts of its code where we think there are big perf gains to be had. We're looking forward to upstreaming performance improvements, and there are WebAssembly proposals that help here too.

  6. cbindgen

    A project for generating C bindings from Rust code

    Project mention: SlateDB – An embedded database built on object storage | news.ycombinator.com | 2024-10-01

    Rust is just another programming language that’s quite similar to C++. The main difference is there’s like 4 types for String (some are references and some are owned) and methods for a struct go in a `impl StructName` block after the struct definition instead of inside it.

    I don’t really know rust either but I’m currently writing some bindings to expose Rust libraries to NodeJS and not having too much trouble.

    For rust -> c++ I googled one time and found this tool which Mozilla seems to use to call Rust from C++ in their web browser, maybe it would “just work”: https://github.com/mozilla/cbindgen?tab=readme-ov-file

  7. rinf

    Rust for native business logic, Flutter for flexible and beautiful GUI

  8. winapi-rs

    Rust bindings to Windows API

  9. SaaSHub

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

    SaaSHub logo
  10. rust-cpython

    Rust <-> Python bindings

  11. jni-rs

    Rust bindings to the Java Native Interface — JNI

  12. swift-bridge

    swift-bridge facilitates Rust and Swift interop.

    Project mention: Crossing the Impossible FFI Boundary, and My Gradual Descent into Madness | news.ycombinator.com | 2024-06-17

    [1] https://github.com/chinedufn/swift-bridge

  13. rust-cpp

    Embed C++ directly inside your rust code!

  14. magnus

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

    Project mention: Magnus: Library for writing Ruby extentions in Rust, running Ruby code from Rust | news.ycombinator.com | 2024-07-01
  15. j4rs

    Java for Rust

    Project mention: J4rs – 'Java for Rust' allows effortless calls to Java from Rust and vice-versa | news.ycombinator.com | 2024-09-26
  16. ext-php-rs

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

    Project mention: Using Rust in Non-Rust Servers to Improve Performance | news.ycombinator.com | 2024-10-24

    The article links to two PHP and Rust integration strategies, WASM[1] or native[2].

    [1] https://github.com/wasmerio/wasmer-php

    [2] https://github.com/davidcole1340/ext-php-rs

  17. duckdb-rs

    Ergonomic bindings to duckdb for Rust

  18. winsafe

    Windows API and GUI in safe, idiomatic Rust.

    Project mention: Winsafe: Low-level Windows API and GUI in safe, idiomatic Rust | news.ycombinator.com | 2024-08-01
  19. nostr

    Nostr protocol implementation, high-level client library, Nostr Wallet Connect, bindings and more. (by rust-nostr)

  20. jlrs

    Julia bindings for Rust

  21. rust-objc

    Objective-C Runtime bindings and wrapper for Rust.

  22. interoptopus

    The polyglot bindings generator for your library (C#, C, Python, …) 🐙

  23. emacs-module-rs

    Rust binding and tools for Emacs's dynamic modules

  24. robusta

    Easy interop between Rust and Java (by giovanniberti)

  25. deno_bindgen

    Write high-level Deno FFI libraries in Rust.

  26. SaaSHub

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

    SaaSHub logo
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).

Rust FFI discussion

Log in or Post with

Rust FFI related posts

  • Pulumi Gestalt 0.0.1 released

    4 projects | dev.to | 10 Mar 2025
  • Pulumi W̶a̶s̶m̶/̶R̶u̶s̶t̶ Gestalt devlog #7

    4 projects | dev.to | 9 Feb 2025
  • Rust Bindings for the Python Interpreter

    1 project | news.ycombinator.com | 11 Jan 2025
  • Ask HN: Python in the NoGIL World

    2 projects | news.ycombinator.com | 20 Dec 2024
  • How to introduce 🦀 Rust at your company 🏭?

    2 projects | dev.to | 19 Dec 2024
  • An interpreter inside an interpreter

    2 projects | dev.to | 25 Nov 2024
  • SlateDB – An embedded database built on object storage

    3 projects | news.ycombinator.com | 1 Oct 2024
  • A note from our sponsor - CodeRabbit
    coderabbit.ai | 17 Mar 2025
    Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR. Learn more →

Index

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

# Project Stars
1 PyO3 13,194
2 rust-bindgen 4,684
3 Rustler 4,463
4 workers-rs 2,785
5 cbindgen 2,553
6 rinf 2,228
7 winapi-rs 1,865
8 rust-cpython 1,819
9 jni-rs 1,323
10 swift-bridge 896
11 rust-cpp 820
12 magnus 704
13 j4rs 682
14 ext-php-rs 636
15 duckdb-rs 592
16 winsafe 543
17 nostr 467
18 jlrs 442
19 rust-objc 394
20 interoptopus 369
21 emacs-module-rs 352
22 robusta 348
23 deno_bindgen 301

Sponsored
CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai

Did you know that Rust is
the 5th most popular programming language
based on number of references?