# xlab/c-for-go

Automatic C-Go Bindings Generator for Go Programming Language

Repository: https://github.com/xlab/c-for-go
Canonical: https://ross.abutalabs.com/products/c-for-go
Homepage: https://c.for-go.com
Language: Go
License: MIT
License Family: permissive
Last push: 2026-03-05T10:17:47+00:00

## Health v2 (maintenance only)
Score: 54/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 70, release rhythm 8, longevity 100
- inputs: {"age_days": 4054, "days_push": 181, "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 1682, forks 121 (observed 2026-08-28T04:05:21.710213+00:00)

## What it is
c-for-go is an automatic C-Go bindings generator for the Go programming language. It parses C headers using a YAML manifest to generate low-level cgo-based Go packages that wrap existing C/C++ libraries.

## Use cases
- generate go bindings for a c library
- wrap c headers in go automatically
- use a c library from go without writing cgo by hand
- create go package from c api headers
- bind vulkan or other c apis to go
- convert c header files to go code

## When to choose
- you need to call an existing C library from Go and want to avoid hand-writing thousands of lines of cgo
- you want reproducible, manifest-driven binding generation for large C APIs
- you are comfortable managing memory and writing a high-level Go wrapper on top of low-level bindings

## When to avoid
- you need a pure-Go solution with no cgo dependency
- the C library is tiny and a few hand-written cgo bindings would be simpler
- you need bindings for languages other than Go

## Facets
- artifact type: cli-tool
- maturity: maintenance
- function: parser, developer-tools
- domain: developer-tools, programming-languages, cross-platform
- platform: go, cli, cross-platform
- tags: cgo, bindings-generator, c-interop, yaml-manifest, code-generation

## Member repositories
- xlab/c-for-go (main) score 54

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:21.710213+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-30T03:41:23.818913+00:00, confidence not recorded.
  - readme: https://github.com/xlab/c-for-go (fetched 2026-08-28T04:05:21.710213+00:00, sha f307772fa0a0)
  - homepage: https://c.for-go.com (fetched 2026-08-29T11:14:22.358890+00:00, sha 2151a305c55b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
