Hacker News new | ask | show | jobs
by bismark 4078 days ago
These are Erlang VM processes which are actually quite fast.

Re ugly: well, eye of the beholder I suppose.

1 comments

Here's a map in my functional language (winter). It's not parallel yet, that shouldn't affect the syntax though. (map is already manifestly parallel)

def square(float x) float : x*x def main(array<float, 256> a) array<float, 256> : map(square, a)

Now make it efficiently parallel and show us the implementation. Then we could compare it with the Elixir snippet, which does just that.
Not just efficiently parallel, but easily distributable to multiple nodes.
Exactly. With a tiny change you can be spawning those processes to any number of other nodes.
Well, if we are putting forth other languages, here's Perl 6:

  sub pmap(Code $func, @items) {
    return await @items.map: {
      start { $func($_) }
    }
  }