I have been trying to write Go bindings to an existing open source C
library. For this, I've read most of the material on CGo available online.
I've also done some small time dummy usage of C functions in Go using CGo.
However, I wanted to know the best practices to follow while doing so.
The library that I'm planning to write Go bindings has exiting ports in
Python using ctype and in Ruby as well. I want to know if they can be of
any use. More importantly I would be thankful if you could provide
suggestion for writing the wrapper.
The current library source consists of about 40 C files including a main
file. My question is that do I
1) write wrappers only for the main file, thus providing a Go layer on top
the existing C layer and provide an Go based interaction point to the
library (if at all this is possible) ?
2) Have the existing C lib exist as a dependency and write Go wrappers on
top of it (on the lines of the Python implementation, where ctypes has been
used this way). ?
3) Re write parts of the original C based library in Go, making maximum use
of its C implementation ?
4) Completely re-write the library in Go (not possible in the interest of
Also, it would be nice if you could point me to an existing library (on
Google Code or Github) that provides Go bindings to an existing C library.
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
For more options, visit https://groups.google.com/groups/opt_out.