Automatically generates Rust FFI bindings to C (and some C++) libraries. (by rust-lang)

Rust-bindgen Alternatives

Similar projects and alternatives to rust-bindgen

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better rust-bindgen alternative or higher similarity.

Suggest an alternative to rust-bindgen

Reviews and mentions

Posts with mentions or reviews of rust-bindgen. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-11-05.
  • Conditionally run some parts of
    2 projects | | 5 Nov 2021
    I'm working on a rather large project that for my own personal convince relies on things like bindgen and the cc crate. Also a couple other things like compiling spirv shaders etc. All of which get's run inside my file.
  • Hey Rustaceans! Got an easy question? Ask here (43/2021)!
    14 projects | | 25 Oct 2021
    if you wanna do it the "right" way, I'd say to make a chafa-sys crate using something like bindgen, then create a wrapper over chafa-sys using idiomatic rust. If you just want a quick access to a few methods, then libc + extern blocks aren't too bad.
  • Linux/bindgen - dealing with struct members being moved into unions
    2 projects | | 23 Jul 2021
    Bindgen issue (mostly for discussion):
  • Can you inspect a foreign object's signature from Rust (DLL / SO loaded library inspection)?
    1 project | | 8 Jul 2021
    I think doing this at runtime is the wrong approach, since the dylib does not contain any signatures, so any solution you come up with will be imperfect. It's much more reliable to use something like the --dynamic-loading option to bindgen to check this when compiling. See
  • Obvious and possible software innovations nobody does
    8 projects | | 19 Jun 2021
    Did you just imply that we put the comments of C headers into our types?! Comments are lower than whitespace as far as the compiler should be sure.

    As I'm sure you are aware does basically what you want.

    I'm actually quite curious where exactly rust-bindgen falls short in the eyes of the author. I'm not as familiar with the other FFI libraries the OP linked.

    8 projects | | 19 Jun 2021
    I really dislike the article, here are some reasons (referencing the numbered arguments in the article).

    1. There are many such parsers. Rusts bindgen [1] is one of them, I have written a proprietary one last year. This is pretty common to do for narrow use cases, there just isn't one for "Convert a C API to Ruby"..

    2. "Most VM designs I’ve seen are basically just student exercises". Seriously? Create a better on and get rich then! I'm pretty sure Google would pay good money for something better than v8.

    3. You can run z/OS on EC2. They do very different things. It's like saying I wish that cars were as simple as a strawberry.

    4. "People used to make GUI frameworks which did more than electron apps, looked better and fit in the tens of kilobytes range." That's correct and that's why lots of apps are based on native UI frameworks. For some use cases, electron seems to hit a sweet spot (mostly not having to write UI for each platform and the web too). If you don't like electron apps, don't use them, most run in the browser too.

    5. "Compilers and interpreters should learn how modern computers work." I don't know where to begin here. Modern compilers optimize for latest hardware all the time, one recent example out of thousand others is this [2] where V8 redundantly inserts short functions into memory regions close to the code they are called from in order to get more instruction cache hits.



  • Anything resembling libpd (Pure Data) for Rust?
    2 projects | | 18 Jun 2021
    Yes, here.
  • Baby's first Rust with extra steps (XPC, launchd, and FFI)!
    7 projects | | 16 Jun 2021
    Our goal is to focus on getting our minimal C example into a Rust project. As a newcomer, rust-analyzer was tremendously helpful for discovering functions and API surface. Get Rust from rustup. Afterwards, make a new directory, cargo init, then set up bindgen. Include the same headers as in the example C program in wrapper.h -- they are in the default search path and require no further setup (find where: xcrun --show-sdk-path).
  • Libfive: Solid modeling (CAD) library/tools with Scheme/Python bindings and GUI
    6 projects | | 24 Apr 2021
    I started working on some Rust bindings for this but I'm currently stuck here[0] with some bindgen issue.

    If anyone wants to help that would be appreciated heaps.


  • Error when building with FFI
    3 projects | | 13 Apr 2021
    I'm unfamiliar with FFI, but it sounds like the C variable uses thread-local storage (TLS) while the generated binding is an ordinary static variable. bindgen made a mistake, see this issue.
  • Choosing between Rust and C++ for a new project
    4 projects | | 1 Apr 2021
    For me, it's no question: for new code, I'd write Rust over C++ any day. The syscalls are all built into the standard library; they're no problem. Even if I had to interact heavily with an existing C/C++ library, bindgen and cxx are fantastic; I'd still write my new code in Rust.
  • Is Julia the right fit for this task?
    1 project | | 18 Mar 2021
    I've written dozens of wrapper libraries in Rust (mostly private) and the vast majority of the time it's very easy to do, especially if you use bindgen, cbindgen, cxx, autocxx, etc. As far as Julia interop goes, I already posted a link to a crate providing high-level interop. That's not even necessary if you're calling a C-ABI rust function from Julia.
  • Opinions on Rust for hard-realtime/systems development?
    2 projects | | 9 Mar 2021
    So... Until at least an year ago? Bindgen and cxx exist already
  • Practicality of embedding a lisp/scheme interpreter that is implemented as C library?
    3 projects | | 2 Mar 2021
    I’ve wrapped a few C/C++ libs with Rust, and getting the “unsafe” part working, especially with bindgen, is straightforward.
  • Haskell ghost knowledge; difficult to access, not written down
    13 projects | | 24 Jan 2021
    Yeah, it is certainly advisable to e.g. avoid setjmp/longjmp as in the Lua example above (this was the main reason for the release of Rust 1.24.1). But even for "Rust-aware" C, one has to write a lot of boilerplate. For example, with bindgen, the go-to tool to create bindings to C headers, one has to write (unsafe) wrapper functions which


Basic rust-bindgen repo stats
2 days ago

rust-lang/rust-bindgen is an open source project licensed under BSD 3-clause "New" or "Revised" License which is an OSI approved license.

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
Find remote C++ jobs at our new job board There is 1 new remote job listed recently.
Are you hiring? Post a new remote job listing for free.