Can I write a go library for use with other languages?

I am writing a relatively small, but not simple network library that will be used from at least C, java, python, ruby, and C #. Is there a way to make go bindings to other languages, how can I make form C? If there is no other way?

+4
source share
2 answers

Right now, you cannot write libraries in Go that can be used in other languages. Go has a runtime that does a lot of things (like process scheduling, garbage collection) for you. This runtime is written under the assumption that it controls the entire program. This assumption is not fulfilled if the Go code will be used from another language, since the Go library cannot influence the binary file that uses it.

+3
source

I believe the JSON service will do what you describe. Check out the json test for a simple example. It doesn't matter which languages ​​you used to install and retrieve data from your application.

0
source

Source: https://habr.com/ru/post/1541289/


All Articles