What?
Using goPy in combination with gccgo it is possible to write CPython extension modules in Go. Once the libraries and command-line tool are installed, the "gopy" command-line tool takes care of generating the necessary C interface code and using gccgo to compile the code into an extension module.
Caveats
There are a few things that should be made clear:
- Calling Go code from a second thread will currently cause the code to raise an exception (i.e. all calls into Go code must be made from the same thread)
- Both the goPy bindings and the gccgo specific extension support code have only undergone the lightest of testing
- The 32 bit version hasn't been tested at all, I actually only built the deb to stop apt-get from complaining
- When using goroutines py.Lock must be used. No other GIL or threading interface functions have been tested - and they most likely will not work.
- Essentially this code is alpha quality at best, and currently primarily exists as proof that it is possible.