logoalt Hacker News

ananthakumarantoday at 2:57 PM3 repliesview on HN

We have a similar use case. All Elixir code base, but need to use Python for ML libraries. We decided to use IPC. Elixir will spawn a process and communicate over stdio. https://github.com/akash-akya/ex_cmd makes it a breeze to stream stdin and stdout. This also has the added benefit of keeping the Python side completely stateless and keeping all the domain logic on the Elixir side. Spawning a process might be slower compared to enqueuing a job, but in our case the job usually takes long enough to make it irrelevant.


Replies

barrelltoday at 5:09 PM

Similar use case as well. I use erl ports to spawn a python process as well. Error handling is a mess, but using python as a short scripting language and elixir for all the database/application/architecture has been very ideal

markstostoday at 4:09 PM

Is this part of a web server or some other system where you could end up spawning N python processes instead of 1 at a time?

show 2 replies
dnauticstoday at 3:35 PM

I have one vibecoded ml pipeline now and I'm strongly considering just clauding it into Nx so I can ditch the python

show 1 reply