Skip to content

Commit

Permalink
Add sponsor.
Browse files Browse the repository at this point in the history
  • Loading branch information
xlab committed Aug 29, 2017
1 parent 9ae9e8c commit d17c297
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 8 deletions.
54 changes: 46 additions & 8 deletions README.md
@@ -1,20 +1,58 @@
## Automatic C Bindings Generator for Go Programming Language
# c-for-go [![Go Report Card](https://goreportcard.com/badge/github.com/xlab/c-for-go)](https://goreportcard.com/report/github.com/xlab/c-for-go)
_Automatic C-Go Bindings Generator for Go Programming Language_

See [for-go.com](https://for-go.com) and the [documentation](https://github.com/xlab/c-for-go/wiki).
The new site is under development (former https://cgogen.com).
This project allows to reuse existing C/C++ libraries in your Go applications, by automatically creating [c-go bindings](https://golang.org/cmd/cgo/) 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](https://github.com/xlab/c-for-go/wiki/Top-5-reasons-to-use-bindings).

The [list of projects](https://github.com/xlab/c-for-go/wiki/Examples) that used c-for-go to generate bindings.
### Process overview

#### Installation
<p align="center">
<img align="center" src="docs/overview.png" height="400px" alt="c-for-go process overview" />
</p>

```
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.

A simple demo case can be seen on the project homepage http://sphere.software/c-for-go.

Full documentation is available at https://github.com/xlab/c-for-go/wiki

### Installation

```bash
$ go get github.com/xlab/c-for-go
```

#### Credits
A simple [Makefile template](https://github.com/xlab/c-for-go/wiki/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/golang-ui/yoga
* ...
* [Request yours](https://sphere.software/c-for-go/enterprise.html)

### Sponsors

<a href="https://sphereinc.com"><img src="docs/sphere.png" width="200px" alt="sphere software sponsor" /></a>

### Credits

* [Jan Mercl](https://github.com/cznic) for his [cznic/cc](https://github.com/cznic/cc) C99 compiler front end package.

#### License
### License

MIT
Binary file added docs/overview.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/sphere.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d17c297

Please sign in to comment.