|Keep It Simple, Stupid|
Re^4: Haskell vs Perl 6 (was Re: Capturing parenthesis and grouping square brackets)by raiph (Chaplain)
|on Jul 04, 2013 at 16:08 UTC||Need Help??|
This is (I suspect) the intent of the perl6 take/gather "at some future point in time", but currently it take is simply a push to a hidden array and once all the values have been collected, the gather subroutine iterates over that array popping them off as it goes.
This is incorrect. The gather/take implementations in Niecza and Rakudo are lazy and have always been.
It could also be done using green (user space) threading; or continuations; or go-style goroutines. And if you believe the P6 specs, it intends to support all of those and more.
The general framework for P6's concurrency and parallel processing capabilities was designed many years ago. The design wisely abstracts across backends with varying concurrency primitives (CLR, JVM, Parrot, and other VMs). Implementations have then followed this design.
Pugs was written in Haskell so had Haskell's capabilities underneath from day 1.
Rakudo was born with usable continuations and coroutines underneath it on day 1 of its existence (because "Parrot is based on continuations"). The threads story is more complex; interested parties would best research for themselves.
"gather/take has controlled the design of Niecza from day 1". Niecza has continuations, coroutines, and threads.