# getditto/safer_ffi

Write safer FFI code in Rust without polluting it with unsafe code

Repository: https://github.com/getditto/safer_ffi
Canonical: https://ross.abutalabs.com/products/safer_ffi
Homepage: http://getditto.github.io/safer_ffi
Language: Rust
License: MIT
License Family: permissive
Last push: 2026-05-04T09:15:43+00:00

## Health v2 (maintenance only)
Score: 59/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 80, release rhythm 8, longevity 100
- inputs: {"age_days": 2287, "days_push": 121, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1052, forks 51 (observed 2026-08-28T04:03:23.396922+00:00)

## What it is
safer_ffi is a Rust framework for writing foreign function interfaces without polluting code with unsafe blocks. It provides attribute macros to export Rust functions and types to C, including automatic C header generation.

## Use cases
- expose rust functions to c callers
- generate c headers from rust code
- write ffi bindings without unsafe code
- build a c-compatible static or dynamic library from rust
- call rust code from c or other languages

## When to choose
- you maintain a rust library consumed from c, c++, or other ffi-capable languages
- you want safe, readable ffi signatures instead of raw pointers
- you need automatic c header generation

## When to avoid
- you need bindings between two non-rust languages
- you need stable, fully mature guarantees - it is still in an alpha/rc stage
- your project is pure rust with no ffi boundary

## Facets
- artifact type: library
- maturity: active
- function: sdk, developer-tools, parser
- domain: developer-tools, programming-languages, cross-platform
- platform: rust, cpp, c, cross-platform
- tags: ffi, bindings, c-interop, header-generation, no-std, unsafe-rust

## Member repositories
- getditto/safer_ffi (main) score 59

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:23.396922+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:59:43.337391+00:00, confidence not recorded.
  - readme: https://github.com/getditto/safer_ffi (fetched 2026-08-28T04:03:23.396922+00:00, sha bc5272e6533e)
  - homepage: http://getditto.github.io/safer_ffi (fetched 2026-08-29T13:01:04.672839+00:00, sha 2523f68bc31e)
  - registry_crates: https://crates.io/api/v1/crates/safer_ffi (fetched 2026-08-29T13:01:04.675457+00:00, sha 813c0a30f952)
- Data as of 2026-08-30T08:39:29.467469+00:00.
