Hacker News new | ask | show | jobs
by jerf 3850 days ago
"I feel Go is not meant to be embedded in Python runtime."

I suspect that it is going to ultimately be your core problem. Even if you make it work with specific versions or specific modules, it'll always be fragile.

Like many modern languages that embed an event loop into themselves one way or another, the Go runtime expects to fully own the target process. It makes it difficult to play well with others, because the "default" C-based runtime provides so few guarantees that it's difficult for two otherwise C-compatible runtimes to "play nice" with each other. It's part of why the JVM and .Net are so interesting for cross-language development; the VM provides a richer, better-specified "base layer" that multiple languages can use, enabling much easier interop.

It's a death-by-a-thousand-cuts sort of thing; hypothetically nothing really prevents this, but in reality you're probably not going to want to take the time to make it work which may very well involve custom modifications of either runtime, when you should probably just go ahead and set up some RPC connections. (JSON's a nice default to prototype quickly, but depending on your needs you may want something like protocol buffers or the half-a-dozen competing libraries.)