3 ms·
Indeed. That means that the interop story for golang is horrible. Golang can somewha work with libraries with C bindings. But you can not publish a golang lib
by rklaehn 3y ago
Indeed.
That means that the interop story for golang is horrible. Golang can somewha work with libraries with C bindings. But you can not publish a golang lib as a lib.so with C bindings because of the runtime.
- bheadmaster 3y agoYou can, actually, using '-buildmode c-shared' and '//export FuncName' comment directive. CGo supports exporting Go functions in shared libraries, and sets up the Go runtime to be used properly with native C types (e.g. int64 will be long long).
- pjmlp 3y agoNot necessarly, .NET and D have a much better interop story, despite having runtimes. You can certainly publish lib.so with Go, here is an example, https://www.ardanlabs.com/blog/2020/07/extending-python-with-go.html https://www.ardanlabs.com/blog/2020/07/extending-python-with...