awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
rust-lang avatar

rust-lang/rust-bindgen

0
View on GitHub↗
5,212 stars·810 forks·Rust·BSD-3-Clause·13 viewsrust-lang.github.io/rust-bindgen↗

Rust Bindgen

Rust-bindgen is a build-time foreign function interface binding generator and C header parser designed to automate cross-language interoperability. It functions as a tool to bridge Rust with C, C++, and Objective-C libraries by producing platform-specific declarations during the compilation process.

The project distinguishes itself through its ability to handle complex C-family language constructs, including C++ inheritance and methods, as well as Objective-C classes and protocols. It ensures binary compatibility across different architectures by calculating target-aware memory layouts and validating that generated structure sizes and alignments match the original source definitions.

The tool provides extensive type mapping for C unions, bitfields, and flexible array members, while mapping untranslatable or complex standard library types to opaque byte blobs. It includes a configuration system for filtering bindings, substituting complex types, and controlling trait derivation or field visibility.

Generated bindings can include extracted documentation from system headers and are processed through a standard formatter to ensure consistent code styling.

Features

  • Rust-C++ Bridges - Automates the creation of type-safe bindings to bridge Rust with C++ libraries, including complex types and inheritance.
  • Native Library Integrations - Provides a tool to execute external native libraries by mapping C/C++ headers to type-safe Rust bindings.
  • FFI Binding CLI Generators - Generates target-specific FFI bindings during the build process to ensure memory layout compatibility across architectures.
  • Rust-C++ FFI Generators - Creates type definitions and FFI declarations from C++ headers, supporting inheritance and methods.
  • Compile-Time Code Generators - Produces platform-specific FFI glue code during the build process to ensure architecture compatibility.
  • Target-Aware Padding & Alignment - Calculates structure padding and alignment by querying the target platform's compiler to ensure binary compatibility.
  • C and Objective-C Interface Mapping - Provides foreign function interface definitions for Objective-C headers by mapping classes to structs and protocols to traits.
  • Native C Interoperability - Bridges C, C++, and Objective-C libraries with Rust by automating the creation of memory-safe declarations.
  • C Function Bindings - Generates bindings that map native C functions to Rust methods for direct execution.
  • C Header Binding Generators - Parses C or C++ headers during the build process to automatically generate foreign function interface signatures.
  • Objective-C Symbol Binding Generators - Creates FFI definitions from Objective-C headers by mapping classes to structs and protocols to traits.
  • Source-To-Source Transpilers - Translates C and C++ language constructs into equivalent foreign function interface signatures in the target language.
  • Compiler-Integrated AST Parsing - Uses an integrated compiler frontend like Clang to parse C headers into abstract syntax trees.
  • Binding Configurations - Provides settings and builder methods to control how source types are translated into target language structures.
  • FFI Declaration Generators - Generates type-safe cross-language interface declarations from both C and C++ header files.
  • Binding Filters - Limits the output to specific types, functions, and variables that match defined rules or dependency requirements.
  • Byte-Compatible Bitfield Generators - Implements tools that generate memory-compatible bitfield structures with typed accessors for low-level language interoperability.
  • Compilation Target Specifications - Specifies a target platform or compiler version to ensure generated bindings match the deployment binary format.
  • FFI Opaque Type Handles - Represents untranslatable types as byte blobs with specific size and alignment to maintain binary compatibility.
  • Opaque Type Definitions - Defines abstract data types as fixed-size byte arrays to hide internal structure and maintain memory layout compatibility.
  • Rust-C++ Type Mappings - Maps complex C++ standard library types to compatible byte blobs with correct size and alignment.
  • Union Mappings - Creates representations of C unions using native union types or specialized structs to ensure layout compatibility.
  • Layout Verifications - Provides validation that generated structure sizes and alignments match the original source definitions to ensure binary compatibility.
  • Target-Aware Binding Generation - Passes specific architecture arguments to the compiler to ensure generated bindings match a non-native target system.
  • Foreign Function Interface - Generates Rust bindings for C/C++ libraries.

Star history

Star history chart for rust-lang/rust-bindgenStar history chart for rust-lang/rust-bindgen

How this analysis was created: This summary and feature list were written by an AI model that read the project's README and public documentation pages. Each feature links to the documentation it came from; stars, license and language come straight from the GitHub API. The model does not read the source code, and the analysis is refreshed when the project is re-analysed. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Open-source alternatives to Rust Bindgen

Similar open-source projects, ranked by how many features they share with Rust Bindgen.
  • dtolnay/cxxdtolnay avatar

    dtolnay/cxx

    6,664View on GitHub↗

    CXX is a code generator that produces a safe, zero-overhead FFI bridge between Rust and C++. It lets functions and data types from either language be used directly in the other, with static type safety enforced at compile time and no copying, serialization, or runtime checks across the boundary. The bridge supports the full range of cross-language interactions: Rust can call C++ functions and use C++ types, and C++ can call Rust functions and use Rust types. Standard library types like strings, vectors, and smart pointers are mapped automatically between the two languages, while opaque types

    Rust
    View on GitHub↗6,664
  • android/ndk-samplesandroid avatar

    android/ndk-samples

    10,513View on GitHub↗

    The Android NDK samples provide a comprehensive collection of code examples demonstrating how to integrate C and C++ native code into Android applications. This repository serves as a practical guide for developers utilizing the Android Native Development Kit to implement performance-critical application components that require direct hardware access and low-level system interaction. The project highlights the use of the Java Native Interface to bridge managed code with native modules, enabling cross-language function calls and efficient data exchange. It demonstrates how to manage native act

    C++
    View on GitHub↗10,513
  • crystal-lang/crystalcrystal-lang avatar

    crystal-lang/crystal

    20,299View on GitHub↗

    Crystal is a statically typed, compiled programming language designed for high performance and memory safety. It leverages an LLVM-based compiler to translate source code into optimized machine-executable binaries, while its type-inference-based static analysis enforces strict safety rules during the build process. The language distinguishes itself through a fiber-based concurrent runtime that manages lightweight execution units for asynchronous input and output without blocking the main process. It also features a powerful compile-time macro system that allows for the inspection and transfor

    Crystalcompilercrystalcrystal-language
    View on GitHub↗20,299
  • cython/cythoncython avatar

    cython/cython

    10,767View on GitHub↗

    Cython is a compiler that translates Python code into C or C++ to create high-performance extension modules. It functions as a static typing optimizer and a C extension generator, allowing developers to declare C types within Python code to reduce interpreter overhead and increase execution speed. The project enables the wrapping of external C libraries to provide high-level interfaces to low-level system capabilities. It also serves as a native binary packager, capable of freezing scripts and their dependencies into standalone executable binaries for distribution. The system covers a broad

    Cythonbig-dataccpp
    View on GitHub↗10,767
See all 30 alternatives to Rust Bindgen→

Frequently asked questions

What does rust-lang/rust-bindgen do?

Rust-bindgen is a build-time foreign function interface binding generator and C header parser designed to automate cross-language interoperability. It functions as a tool to bridge Rust with C, C++, and Objective-C libraries by producing platform-specific declarations during the compilation process.

What are the main features of rust-lang/rust-bindgen?

The main features of rust-lang/rust-bindgen are: Rust-C++ Bridges, Native Library Integrations, FFI Binding CLI Generators, Rust-C++ FFI Generators, Compile-Time Code Generators, Target-Aware Padding & Alignment, C and Objective-C Interface Mapping, Native C Interoperability.

What are some open-source alternatives to rust-lang/rust-bindgen?

Open-source alternatives to rust-lang/rust-bindgen include: dtolnay/cxx — CXX is a code generator that produces a safe, zero-overhead FFI bridge between Rust and C++. It lets functions and… android/ndk-samples — The Android NDK samples provide a comprehensive collection of code examples demonstrating how to integrate C and C++… crystal-lang/crystal — Crystal is a statically typed, compiled programming language designed for high performance and memory safety. It… cython/cython — Cython is a compiler that translates Python code into C or C++ to create high-performance extension modules. It… c3lang/c3c — c3c is the compiler for the C3 programming language, transforming source code into executable binaries, static… jerryscript-project/jerryscript — JerryScript is a lightweight, ECMAScript-compliant JavaScript engine and bytecode compiler designed for…