Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
prologic opened this issue Jul 10, 2015 · 4 comments
Open
Assignees
Labels

Comments

@prologic
Copy link

@prologic prologic commented Jul 10, 2015

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
Copy link
Owner

@sbinet sbinet commented Jul 10, 2015

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

  • not really convenient (and one will have to drop to cgo quite a lot)
  • until go-1.5, it won't be easy to compile a shared object and load it from a regular python prompt.

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
Copy link
Author

@prologic prologic commented Jul 10, 2015

@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
Copy link
Owner

@sbinet sbinet commented Jul 10, 2015

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...)

@sbinet sbinet self-assigned this Jul 10, 2015
@sbinet sbinet added the question label Jul 10, 2015
@prologic
Copy link
Author

@prologic prologic commented Jul 10, 2015

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.