# libffi/libffi

A portable foreign-function interface library.

Repository: https://github.com/libffi/libffi
Canonical: https://ross.abutalabs.com/products/libffi
Homepage: http://sourceware.org/libffi
Language: C
License: NOASSERTION
License Family: other
Last push: 2026-08-19T09:13:06+00:00

## Health v2 (maintenance only)
Score: 94/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 84, longevity 100
- inputs: {"age_days": 6182, "days_push": 14, "days_rel": 25, "gap_med": 40.5, "n_releases_24m": 9}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4361, forks 824 (observed 2026-08-28T04:08:46.549584+00:00)

## What it is
libffi is a portable C library providing a high-level interface to various calling conventions, allowing code to call compiled functions whose signatures are only known at runtime. It is the machine-dependent foundation layer used by projects like CPython's ctypes and OpenJDK to bridge interpreted and native code.

## Use cases
- call native C functions at runtime with dynamically determined signatures
- build a bridge between an interpreter and compiled code
- implement ctypes-style foreign function interface bindings
- invoke functions with unknown argument types in a scripting language runtime
- port a language runtime to multiple CPU architectures and ABIs

## When to choose
- you need runtime function calls into native code without compile-time signatures
- you are building an interpreter, VM, or FFI binding layer
- you need broad architecture and OS portability for calling conventions

## When to avoid
- you can bind functions statically at compile time
- you need high-level type marshalling between languages (libffi only provides the low layer)
- you need a pure-language solution without native dependencies

## Facets
- artifact type: library
- maturity: stable
- function: interpreter, compiler, developer-tools
- domain: programming-languages, developer-tools, cross-platform
- platform: windows, cross-platform, cpp, c
- tags: ffi, foreign-function-interface, calling-conventions, c-library, runtime, interop, linux, macos

## Member repositories
- libffi/libffi (main) score 94

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:46.549584+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-29T18:21:27.078713+00:00, confidence not recorded.
  - readme: https://github.com/libffi/libffi (fetched 2026-08-28T04:08:46.549584+00:00, sha 502b1228b9be)
  - homepage: http://sourceware.org/libffi (fetched 2026-08-29T09:10:00.335710+00:00, sha c60413653cc4)
- Data as of 2026-08-30T08:39:29.467469+00:00.
