Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Rust
  3. rusty-cheddar

rusty-cheddar

Rustv0.3.3

A Rust crate for automatically generating C header files from Rust source code, enabling C interoperability.

Visit WebsiteGitHubGitHub
187 stars25 forks0 contributors

What is rusty-cheddar?

rusty-cheddar is a Rust crate that automatically generates C header files from Rust source code, enabling interoperability between Rust libraries and C programs. It solves the problem of manually creating and maintaining C headers for Rust APIs, ensuring type safety and compatibility. The tool is particularly useful for projects that need to expose Rust functionality to C-based systems.

Target Audience

Rust developers who need to create C-compatible interfaces for their libraries, such as those building FFI (Foreign Function Interface) bindings or integrating Rust code into existing C codebases.

Value Proposition

Developers choose rusty-cheddar for its automation of header generation, reducing manual effort and potential errors. Its integration with Cargo build scripts streamlines the build process, and its support for common Rust-to-C type conversions ensures reliable interoperability.

Overview

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

Use Cases

Best For

  • Generating C headers for Rust libraries in build scripts
  • Creating FFI bindings between Rust and C codebases
  • Exporting Rust enums and structs to C with #[repr(C)]
  • Defining opaque structs to hide Rust implementation details in C
  • Automating C API generation for Rust projects
  • Ensuring C99 compatibility for Rust-generated headers

Not Ideal For

  • Projects requiring support for C standards older than C99, as it targets C99 or later and the author is reluctant to implement older standards
  • Teams needing actively maintained tools with regular updates and bug fixes, since the project is deprecated in favor of cbindgen
  • Codebases that heavily use generics in public enums or structs, as rusty-cheddar fails on generic types and tuple variants
  • Developers looking for a robust solution with comprehensive documentation and easy test setups, given its hacky tests and specific dependencies

Pros & Cons

Pros

Automatic Header Generation

Converts Rust source files into C header files automatically, reducing manual effort and errors in creating FFI bindings, as shown in the build script examples.

Build Script Integration

Designed to be used within Cargo build scripts for seamless header creation during compilation, simplifying the build process for Rust-C interoperability.

Opaque Struct Support

Allows defining opaque structs via newtypes marked #[repr(C)], enabling the use of arbitrary Rust structs in C while hiding implementation details.

C99 Compatibility Focus

Targets C99 or later standards, leveraging stdint.h and stdbool.h for type safety and using single-line comments, ensuring modern C compatibility.

Cons

Deprecated and Unmaintained

The project is no longer actively maintained, with the README explicitly recommending cbindgen for more features, making it risky for new or ongoing projects.

Limited Type and Feature Support

Fails on generics in enums and structs, diverging functions, and requires fully qualified paths for libc types, restricting complex API exposures.

Pre-1.0.0 Instability

In pre-v1.0.0 state, it undergoes frequent breaking changes with minor version bumps, leading to potential instability and migration headaches.

Cumbersome Test Requirements

Tests require a specific version of CppHeaderParser and must be run from the project directory, indicating poor test infrastructure and setup complexity.

Frequently Asked Questions

Quick Stats

Stars187
Forks25
Contributors0
Open Issues20
Last commit8 years ago
CreatedSince 2015

Tags

#header-generation#ffi#c-interop#rust#no-std#code-generation#c99#build-tool

Built With

R
Rust

Links & Resources

Website

Included in

Rust56.6k
Auto-fetched 8 hours ago

Related Projects

RustPythonRustPython

A Python Interpreter written in Rust

Stars22,340
Forks1,484
Last commit19 hours ago
PyO3PyO3

Rust bindings for the Python interpreter

Stars16,116
Forks1,016
Last commit20 hours ago
wasm-bindgenwasm-bindgen

Facilitating high-level interactions between Wasm modules and JavaScript

Stars9,145
Forks1,242
Last commit9 hours ago
NeonNeon

Rust bindings for writing safe and fast native Node.js modules.

Stars8,425
Forks287
Last commit7 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub