Erlang/Python - ZMQ vs Ports, what are the pros and cons?

Hello everyone, I am relatively new to erlang. I would like to connect Python and Erlang, both are on the same machine.

I have used ZMQ and Erlang ports. For ZMQ I used the chumak library. Both worked well.

Unfortunately, the pros and cons are not entirely clear to me.

When I use Erlang Ports I can supervise my Python process. If I use ZMQ chumak I can only supervise my ZMQ connection (Erlang process). Is this correct?
Can I combine ZMQ and Erlang ports and for example send heartbeats via ports to supervise the specific Python process? Does that make sense at all?

thanks
frank

Since you’re talking specifically about Python, I can recommend Pyrlang ( https://pyrlang.github.io/Pyrlang/ ) as a way to make your python processes first class citizens in Erlang. Our team has used it for a few things and it went quite well. Of course you don’t want a bunch of Python erlang processes because they’re heavyweight but the Pyrlang APIs make coordination between the two environments much nicer.

– Ben Scherrey

2 Likes

I would also recommend Pyrlang.

1 Like

Thanks for the quick reply. I will definitely take a closer look at Pyrlang .