<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 31, 2014 at 8:12 AM, Joe Armstrong <span dir="ltr"><<a href="mailto:erlang@gmail.com" target="_blank">erlang@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Let me pitch a silly idea at you.<div><br>
</div>
<div>Why don't we just use gen_tcp and interact with 0MQ peers using the</div><div>wire-line protocol. Erlang is good at getting data in and out of sockets,</div>
<div>and good at parsing binary packets.</div><div><br></div><div>This method is safe and efficient. I mailed Pieter Hintjens about this</div><div>and he thought this was perfectly doable.</div><div><br></div><div>I'm not suggesting implementing all the protocols and transports to start with</div>


<div>just the REQ - REP protocols of TCP</div><div><br></div><div>Pieter suggest looking at</div><div><br></div><div>   <a href="https://github.com/zeromq/zmtp" target="_blank">https://github.com/zeromq/zmtp</a><br></div>

<div>   <a href="https://github.com/zeromq/libzmq/blob/master/tests/test_stream.cpp" target="_blank">https://github.com/zeromq/libzmq/blob/master/tests/test_stream.cpp</a><br>
</div><div><br></div><div>These implement the wire-line protocol on top of tcp rather than through the </div><div>0mz library so its easier to see whats going on.</div><div><br></div><div>Now I haven't a clue if this is a silly idea or not - but a few hours tinkering</div>


<div>should be enough to implement the REQ-REP protocols and make some performance</div><div>measurements - and that would tell me if it's worth implementing more protocols</div><div>and transports.</div><div><br></div>


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


( actually all I want to do is get Erlang talking to Julia - Julia speaks 0MQ and I found that I</div><div>couldn't build the Erlang 0MQ bindings with the latest 0MQ - so I'm again back to</div><div>"fixing stuff thats broken" in order to do what I want. I don't really want to have to re-implement</div>


<div>the 0MQ wire-line protocol to do this - but it does seem easier than fixing up the broken library</div><div>and maintaining it (I guess it's easier since I only need a fraction of the entire protocol))</div><div>


<br></div><div>Comments</div><span class=""><font color="#888888"><div><br></div><div>/Joe</div><div><br></div></font></span></div></blockquote><div><br></div><div>gen_zmq was doing that but it wasn't update since a long time:</div>

<div><br></div><div><a href="https://github.com/RoadRunnr/gen_zmq">https://github.com/RoadRunnr/gen_zmq</a><br></div><div><br></div><div>Maybe a good start?</div><div><br></div><div>- benoit</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div dir="ltr"><span class=""><font color="#888888"><div></div></font></span></div><div class=""><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 30, 2014 at 10:58 PM, Garrett Smith <span dir="ltr"><<a href="mailto:g@rre.tt" target="_blank">g@rre.tt</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>On Thu, Jan 30, 2014 at 3:13 PM, Joe Armstrong <<a href="mailto:erlang@gmail.com" target="_blank">erlang@gmail.com</a>> wrote:<br>



> Is anybody working on upgrading the 0MQ libraries for erlang to<br>
> the latest version of 0QM.<br>
<br>
</div>I would be tempted to upgrade them, but I've wanted to have an<br>
external C port implementation of the 0MQ bindings for a while and so<br>
created this:<br>
<br>
<a href="https://github.com/gar1t/erlang-czmq" target="_blank">https://github.com/gar1t/erlang-czmq</a><br>
<br>
In my three years of experience with the 0MQ bindings, it's been<br>
(historically) very easy to crash the Erlang VM. For my applications,<br>
speed will never justify the cost of taking an entire node down. The<br>
CZMQ bindings I have here are quite slow relative to erlzmq2 (~ 5 - 10<br>
times slower). I'm sure they can be made much faster, but my thinking<br>
is that running multiple external ports could alleviate this.<br>
<br>
Speed kills.<br>
<br>
This code is not running in production, but it will be soon.<br>
<br>
The CZMQ API in my opinion is the right target for new 0MQ bindings,<br>
regardless of how they're implemented. Pieter Hintjen's rationale for<br>
writing CZMQ is here:<br>
<br>
<a href="https://github.com/zeromq/czmq#scope-and-goals" target="_blank">https://github.com/zeromq/czmq#scope-and-goals</a><br>
<span><font color="#888888"><br>
Garrett<br>
</font></span></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div></div>