Get the latest tech news
Calling Go from Elixir with a CNode in Crystal
At Mozi, we needed to connect a new Elixir Phoenix LiveView app to an existing Go backend. This is how we did it. …
I have actually done this before and it works: you can compile the Go code into a C ABI library and then call it from Elixir via NIFs (Native Implemented Functions). We then wrote a small C wrapper that processes some CLI args and environment variables, and starts looping on the inbound messages. We build and deploy the Crystal/Go code as a single Docker container, running in the same Kubernetes pod as the Elixir app.
Or read this on Hacker News