Dave Whipp wrote:
> I was reading Synopsis 4 with regards to multi core programming. It 
> seems to be infused with a bias towards non-parallel models of 
> computation. Concurrently appears to be an add-on feature -- whereas we 
> should have a mindset that explicit sequential constraints are the 
> add-on feature.

That sounds really like a bad idea for simple "just do it" scripts. Just
imagine explaining concurrency issue to a beginner who is not even
confident with variables and blocks...

> Two statements that are missing from S04 (feel free to change the names) 
> are C<forall>; and a form of C<given> that tests/executes multiple 
> C<when> clauses in arbitrary order (without needing the sequential 
> C<continue> statement).
> 
> 
>    forall @a -> $x { ... }
> 
> runs the code block on each element of @a (no defined order). 

You can achieve that with the "hyper" list-op (see S02).
Also note that an optimizer is free to automatically add the "hyper"
list op if it can prove that the executed block has no side effects.

...
> Similarly, C<map>, C<classify>, C<grep>, C<reduce>, ... should all 
> accept this ":sequential" adverb to force them to iterate their lists 
> sequentially -- and should otherwise iterate in arbitrary/concurrent order.

Some of this can be written with hyper ops, just as the dot for method
calls has a "hyper dot" Object>>.method

> I'm not too concerned about the exact details: my point is that we 
> should be fully aware of the fact that perl6 will be released into a 
> multicore (some people use the term many-core for devices with hundreds 
> of cores) world, and that exploitation of these parallel resources 
> should be the default (easy) behavior. We shouldn't have a "concurrency" 
> synopsis (we don't -- but we do have Spec/concurrency.pod). Instead, we 
> should have "sequential.pod" that defines how to impose additional 
> sequential constraints (e.g. ":atomic", ":sequential") on top of the 
> those inferred from data dependencies.

I think that the concurrency synopsis is still useful for explicit
threading, STM and the like.

Also note that Perl 6 tries to preserver Perl's soul, and is not an
Erlang based language ;-)

Cheers,
Moritz

-- 
Moritz Lenz
http://moritz.faui2k3.org/ |  http://perl-6.de/

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to