Hacker News new | ask | show | jobs
by Ono-Sendai 4078 days ago
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)

2 comments

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($_) }
    }
  }