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.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of crystal

crystal

Photo of elixir

elixir

Photo of cnode

cnode

Related news:

News photo

LLMs and Elixir: Windfall or Deathblow?

News photo

Writing A Job Runner (In Elixir) (Again) (10 years later)

News photo

Lua for Elixir