I currently use Cython to link C and Python, and get speedup in slow bits of python code. However, I'd like to use goroutines to implement a really slow (and very parallelizable) bit of code, but it must be callable from python. (I've already seen this question)
I'm (sort of) happy to go via C (or Cython) to set up data structures etc if necessary, but avoiding this extra layer would be good from a bug fix/avoidance point of view.
What is the simplest way to do this without having to reinvent any wheels?
Update 2015: possible as of Go 1.5 https://blog.filippo.io/building-python-modules-with-go-1-5/
with Go 1.5 you can build .so objects and import them as Python modules, running Go code (instead of C) directly from Python.
See also https://github.com/go-python/gopy
gopy generates a CPython extension module from a go package.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With