xlab/c-for-go
xlab/c-for-go has 1,685 GitHub stars and 123 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-06 05:23 UTC. Last push 2026-03-05.
Automatic C-Go Bindings Generator for Go Programming Language
Measured star growth
- in 24h
- 0
- in 7 days
- Update delayed
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Originalc-for-go 

Automatic C-Go Bindings Generator for Go Programming Language
This project allows to reuse existing C/C++ libraries in your Go applications, by automatically creating c-go bindings for a given set of C headers and the manifest file. We believe in component-based software engineering and think that reusing C/C++ code in Go applications could bring a huge boost to developer's productivity and system's performance. Read more about the motivation: top reasons to use bindings.
Process overview
The only component required to produce a Go package that will wrap the source C/C++ code is the YAML manifest file that defines parsing, translation and generation rules. The manifest can have just a few lines, however in order to match Go's naming conventions and provide enough tips for type conversions it usually contains about 100 lines, which is still better than producing tens of thousands lines of Go code by hand.
The resulting bindings are as low-level as C code, i.e. it would require knowledge of memory management to carefully use the resulting code, however no more C code is needed to make things done. Eventually some functions can be replaced manually with pure-Go analogs. Also usually a high-level wrapper is created by hand, to introduce Object Oriented Design into API, manage inner state and memory, thus making things safe and lifting the mental overhead.
Full documentation is available at https://github.com/xlab/c-for-go/wiki
Installation
$ go install github.com/xlab/c-for-go@latest
A simple Makefile template.
In action
- https://github.com/xlab/android-go 🌟
- https://github.com/vulkan-go/vulkan 🌟
- https://github.com/golang-ui/nuklear
- https://github.com/xlab/pocketsphinx-go
- https://github.com/xlab/libvpx-go
- https://github.com/xlab/portaudio-go
- https://github.com/xlab/portmidi
- https://github.com/xlab/alac-go
- https://github.com/xlab/vorbis-go
- https://github.com/xlab/opus-go
- https://github.com/xlab/libpd-go
- https://github.com/zenhotels/lmdb-go
- https://github.com/zenhotels/libpostal-go
- https://github.com/xlab/hamlib-go
- https://github.com/5k3105/nidaq
- https://github.com/SphereSoftware/pdf-go
- ...
- Request yours
Credits
License
MIT
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
560,359 starspublic-apis/public-apis
A collective list of free APIs
496,646 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
437,152 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,047 stars