sbinet / go-python

naive go bindings to the CPython2 C-API
Other
1.53k stars 138 forks source link

Question: Using go-python to write CPython C-extensions into Go libraires #25

Open prologic opened 9 years ago

prologic commented 9 years ago

As per the title; Is this possible here? I haven't really looked too deeply into this (yet) but if it's possible I think I'd like to have a go at doing so.

sbinet commented 9 years ago

it is technically possible to write a CPython extension module in Go, but:

in the (hopefully) not too far future, I'll resume working on github.com/go-python/gopy-gen which should provide a much more user friendly recipe.

see #24 for some more background.

prologic commented 9 years ago

@sbinet Thanks for your quick response! A bit of background to what I'm trying to achieve here. I'm developing several tools (autodock, domains and factory) but especially factory which at present wraps around the CLI of Docker Machine via sh -- However it would be really nice if I could integrate Docker Machine at a library level.

sbinet commented 9 years ago

well, for this particular case, I wouldn't be surprised if a JSON/REST api were to appear at some point (api which you could then call directly from python...)

prologic commented 9 years ago

Perhaps but that would incur the same cost and overheads as invoking subprocesses :) All good though -- we'll see how things evolve. Nonetheless though I look forward to your gopy-gen because I belive this will be generally useful!