[erlang-questions] 0MQ libraries

Joe Armstrong <>
Fri Jan 31 08:12:04 CET 2014


Let me pitch a silly idea at you.

Why don't we just use gen_tcp and interact with 0MQ peers using the
wire-line protocol. Erlang is good at getting data in and out of sockets,
and good at parsing binary packets.

This method is safe and efficient. I mailed Pieter Hintjens about this
and he thought this was perfectly doable.

I'm not suggesting implementing all the protocols and transports to start
with
just the REQ - REP protocols of TCP

Pieter suggest looking at

   https://github.com/zeromq/zmtp
   https://github.com/zeromq/libzmq/blob/master/tests/test_stream.cpp

These implement the wire-line protocol on top of tcp rather than through
the
0mz library so its easier to see whats going on.

Now I haven't a clue if this is a silly idea or not - but a few hours
tinkering
should be enough to implement the REQ-REP protocols and make some
performance
measurements - and that would tell me if it's worth implementing more
protocols
and transports.

The difficulty of this is not writing the code - but understanding the
wire-line protocol
but I think Pieter has done a good job here, there are a load of RFCs at
the 0MQ web site.

( actually all I want to do is get Erlang talking to Julia - Julia speaks
0MQ and I found that I
couldn't build the Erlang 0MQ bindings with the latest 0MQ - so I'm again
back to
"fixing stuff thats broken" in order to do what I want. I don't really want
to have to re-implement
the 0MQ wire-line protocol to do this - but it does seem easier than fixing
up the broken library
and maintaining it (I guess it's easier since I only need a fraction of the
entire protocol))

Comments

/Joe



On Thu, Jan 30, 2014 at 10:58 PM, Garrett Smith <> wrote:

> On Thu, Jan 30, 2014 at 3:13 PM, Joe Armstrong <> wrote:
> > Is anybody working on upgrading the 0MQ libraries for erlang to
> > the latest version of 0QM.
>
> I would be tempted to upgrade them, but I've wanted to have an
> external C port implementation of the 0MQ bindings for a while and so
> created this:
>
> https://github.com/gar1t/erlang-czmq
>
> In my three years of experience with the 0MQ bindings, it's been
> (historically) very easy to crash the Erlang VM. For my applications,
> speed will never justify the cost of taking an entire node down. The
> CZMQ bindings I have here are quite slow relative to erlzmq2 (~ 5 - 10
> times slower). I'm sure they can be made much faster, but my thinking
> is that running multiple external ports could alleviate this.
>
> Speed kills.
>
> This code is not running in production, but it will be soon.
>
> The CZMQ API in my opinion is the right target for new 0MQ bindings,
> regardless of how they're implemented. Pieter Hintjen's rationale for
> writing CZMQ is here:
>
> https://github.com/zeromq/czmq#scope-and-goals
>
> Garrett
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140131/168662c0/attachment.html>


More information about the erlang-questions mailing list