8 ms·
For completeness' sake, Haskell has had this for over a decade :) A SO thread that gives a nice overview [0], the paper [1], the library [2]. Here's how a paral
by pka 7y ago
For completeness' sake, Haskell has had this for over a decade :) A SO thread that gives a nice overview [0], the paper [1], the library [2]. Here's how a parallel fib looks like:
fib :: Int -> Int
fib n
| n <= 1 = 1
| otherwise = x ‘par‘ (y ‘pseq‘ x + y + 1)
where
x = fib (n-1)
y = fib (n-2)
[0] https://stackoverflow.com/questions/958449/what-is-a-spark-in-haskell https://stackoverflow.com/questions/958449/what-is-a-spark-i...
[1] http://simonmar.github.io/bib/papers/strategies.pdf http://simonmar.github.io/bib/papers/strategies.pdf
[2] http://hackage.haskell.org/package/parallel-3.2.2.0/docs/Control-Parallel.html http://hackage.haskell.org/package/parallel-3.2.2.0/docs/Con...
- pkofod 7y agoFor complete completenes sake, Haskell has existed for almost three decades :)
- dwohnitmok 7y agoWhile the earliest versions of Haskell date back that far, those combinators only came out in 2007 (IIRC).
- chrisseaton 7y agoThose functions weren’t part of Haskell back then.
- pkofod 7y agoWhat do you mean? That's my point exactly. While Haskell has that now, they didn't always have it. If a programming language is created in 2019 they can certainly instantly incorporate insights from existing technology in their design an plans. However, that doesn't mean that any programming language/compiler project started today will instantly have all of those features. Things take time in each new framework.
- deleted 7y ago[deleted]
- chrisseaton 7y agoI don't know what your point is, then. Haskell didn’t have it originally. Ok. But what do you think that says about whether it’s a new idea or not? What’s the connection? Why mention it in this thread about whether it's a new idea or not?
- StefanKarpinski 7y agoAt what point did anyone claim it was a new idea? The blog post cites prior art in the very first paragraph. Not in a footnote—in the main text. The top post here cites several other languages with a similar model. This entire thread reads like a bunch of dudes who are really dying to "well, actually" someone.
- chrisseaton 7y agoI think people were responding to > The only systems which have supported compute-oriented composable parallelism like this are Cilk and TBB Because it isn’t true. Haskell is an example of why it isn’t true.
- StefanKarpinski 7y agoIt's extremely debatable that Haskell is compute-oriented. I know that Haskell people like to talk about doing numerical computing in Haskell, but in reality it does not seem to be a thing. No one has ever used Haskell to implement large scale scientific computations on supercomputers, for example.
- tavert 7y agoNo one? Ever? https://onlinelibrary.wiley.com/doi/full/10.1002/cpe.3746 https://onlinelibrary.wiley.com/doi/full/10.1002/cpe.3746
- cygx 7y agoPerl6 also has been able to do this for a couple of years: sub fib(Int $n) { return $n if $n < 2; my $t = start { fib($n - 2) } fib($n - 1) + await($t); }