4 ms·
Sadly the experiment I did isn't public. My memory is I compiled the Go thing to a shared library, and exposed a C API, and then used cffi to talk to the C API
by itamarst 9y ago
Sadly the experiment I did isn't public. My memory is I compiled the Go thing to a shared library, and exposed a C API, and then used cffi to talk to the C API (based on https://blog.filippo.io/building-python-modules-with-go-1-5/ https://blog.filippo.io/building-python-modules-with-go-1-5/, except cffi instead of Python C API).
Go objects needed to be managed C style: internally Go thing had a map between integer identifier and object, and Python just got the integer identifier and had to manually tell Go code to deallocate.
- cakes 9y agoI was recently trying to do something similar and looked/tried go as a solution but I ran into some initial issues around my own confidence that the shared lib would work and that I wouldn't eventually really mess up the deallocation step.