go-python / gopy

gopy generates a CPython extension module from a go package.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How hard would it be to generate C bindings instead of Python bindings?

hwittenborn opened this issue · comments

Hi! I just encountered this library, and I was wondering how hard it would be to use this code to generate C bindings instead of Python bindings. I haven't looked into this library too much yet, but the premise of it sounds really nice, and I'm just wanting a convenient way for me to start using a Go library in Rust, and if a C interface could automatically be generated than the rest of that could just be taken care of.

I'm just throwing it out to start some conversation, I'd be willing to look into implementing it myself if need be, but just some talk on what would need to be done first would be good on my end.

Yeah I think it would be fairly straightforward -- it generates a C intermediary file and then python interfaces with that with its own wrapper.

There is another package you might want to check out: https://github.com/xlab/c-for-go and probably others..