Hi Peer,<div><br></div><div>Thank you very much for your wise replies!</div><div><br></div><div>>Are you meaning message passing in the Erlang sense?  This seems a bit<br>overkill then.
</div><div><br></div><div>Yes, I mean Message Passing.</div><div><br></div><div>>Your description of the algorithm confuses me, can't you describe this<br>more in the sense of matrix operations than message passing?<br>
<br>>It is unclear how the timing of your messages should be? Some kind of<br>synchronous?  All at once? Asynchronous in whatever order?
</div><div><br></div><div>Yes, the messages are passed in synchronous way, not all at once but step-by-step: every node sends messages to its next neighbors at the same time with other nodes who got a message simultaneously, and the speed of messages is constant.</div>
<div><br></div><div>>Be aware that syntax is secondary, semantics is the important<br>differentiation factor.<br><br>>If you want to do this with lists does this mean you first want to<br>distribute the "messages" in the direction of the innermost dimension<br>
etc?
</div><div><br></div><div>Yes.</div><div><br></div><div>>You need to give us more information what you *really* want to achieve<br>by this algorithm.  Maybe its the wrong algorithm for doing this in<br>erlang.  As you described it I at least can't understand what exactly<br>
you want to achieve with this.
</div><div><br></div><div>I hope to know there are how many paths across a specific point in a cubic lattice if we walk from the origin to the far-most diagonal point.</div><div><br></div><div><br></div><div>Thank you for your suggestion about Lisp learning.</div>
<div><br></div><div><br></div><div>Best regards,</div><div>Barco</div><div><br><div class="gmail_quote">On Thu, Nov 10, 2011 at 3:08 AM, Peer Stritzinger <span dir="ltr"><<a href="mailto:peerst@gmail.com">peerst@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Wed, Nov 9, 2011 at 6:31 AM, Barco You <<a href="mailto:barcojie@gmail.com">barcojie@gmail.com</a>> wrote:<br>

> As known, Erlang is born with inherent distributed-computing properties and<br>
> is good for lists manipulation, but currently I'm encountering a problem<br>
> that I don't know how to do with Erlang in an efficient way.<br>
<br>
</div>There is no code to see yet but you might watch<br>
<br>
<a href="https://bitbucket.org/peerst/numerlang/wiki/Home" target="_blank">https://bitbucket.org/peerst/numerlang/wiki/Home</a><br>
<br>
I'm working on a ndimarray module in my spare time, my plans are under<br>
the above link.<br>
<div class="im"><br>
> I hope to build a cubic matrix with I x J x K dimension (I,J,K are integers<br>
> and >= 2), for which the origin (index [1,1,1], or [0,0,0] for c/java/lisp)<br>
> is assigned with an initial value 1, and then the initial value is<br>
> unidirectionally message-passed to adjacent nodes.<br>
<br>
</div>Are you meaning message passing in the Erlang sense?  This seems a bit<br>
overkill then.<br>
<div class="im"><br>
> Every node gets a value<br>
> that is the sum of afferent messages and continue to pass its value deeper<br>
> forward, until the far-most node (with index [I,J,K]) gets a value. Taking a<br>
> 2x2x2 dimensional scenario as an example (in the attached picture, the<br>
> vertices of the cube represent the nodes of the matrix), we will get a final<br>
> matrix as [ [ [1,1], [1,2] ], [ [1,2], [2,6] ] ].<br>
<br>
</div>Your description of the algorithm confuses me, can't you describe this<br>
more in the sense of matrix operations than message passing?<br>
<br>
It is unclear how the timing of your messages should be? Some kind of<br>
synchronous?  All at once? Asynchronous in whatever order?<br>
<div class="im"><br>
> To implement this, I'll have two functions: gen_cubic([I,J,K]) -> list().<br>
>  get_value([i,j,k], Cubic::list()) -> number().<br>
> BTW: I heard of that Lisp is good for this kind of matter, but when I tried<br>
> to learn List yesterday I found it's so hard to read and the syntax is not<br>
> so natural as Erlang.<br>
<br>
</div>Be aware that syntax is secondary, semantics is the important<br>
differentiation factor.<br>
<br>
If you want to do this with lists does this mean you first want to<br>
distribute the "messages" in the direction of the innermost dimension<br>
etc?<br>
<br>
You need to give us more information what you *really* want to achieve<br>
by this algorithm.  Maybe its the wrong algorithm for doing this in<br>
erlang.  As you described it I at least can't understand what exactly<br>
you want to achieve with this.<br>
<br>
Anything that can be done in Lisp *except* macros can usually be done in Erlang.<br>
<div class="im"><br>
> So, if someone have more time, please give your<br>
> insights comparing these two language. I would appreciate that.<br>
<br>
</div>Lisp and Erlang are similar up to a point (there is even a Lisp<br>
flavored Erlang = LFE front-end).<br>
Lisp lists are identical to Erlang lists.<br>
Lisp macros are not available in Erlang syntax.<br>
Erlang has pattern matching, very lightweight processes and message<br>
passing that Lisp doesn't have.<br>
<br>
But on the other hand: The way Lisp is programmed is that it turns<br>
into whatever domain specific language your problem needs as you go<br>
along.  So in theory at least Lisp can be made to do all these things.<br>
What can't be done easily in Lisp is getting the performance,<br>
low-latency and robustness characteristics of Erlang.<br>
<br>
My suggestion: learn both, pick the one you like most first.  And when<br>
you know Lisp and Erlang, learn another language and so on ...<br>
<span class="HOEnZb"><font color="#888888"><br>
-- Peer<br>
</font></span></blockquote></div><br></div>