Norbert Nemec | 1 Jul 23:44

Parallel vs. sequential loops

Hi there,

this short statement by Guy Steele about parallel vs. sequential loops 
in Fortress got me thinking. The discussion has always been about which 
kind of loop should be the default. Making loops parallel by default 
means a risk of subtle errors by non-thinking programmers. Making them 
sequential by default means a potential loss of performance by 
non-thinking programmers. Maybe the best way is the third option: avoid 
a default and make both kinds of loops explicit, distinct, elegant and 
short to type. One first idea would be:

    seqloop i <- 0#n
vs.
    parloop i <- 0#n

alternatives would be
     "seq" vs. "par"
     "loop" vs. "branch"
     "iterate" vs. "branch"

or maybe something completely different. Key point is that neither 
should be simpler to type and the difference should be directly obvious.

On top of this, the compiler could then of course still try to check 
whether the wrong loop type might have been used and print a warning or 
a hint, but it should rather try to make the programmer think than to 
make him lazy.

Greetings,
Norbert

Guy Steele wrote:
> Hi, Dmitrey.
>
> On Jun 29, 2008, at 11:43 AM, dmitrey wrote:
>> ...
>> P.S. I also had made some proposition, mostly rejected of course, but 
>> there is a one issue I can't take: I still consider parallel cycle 
>> implementation syntax remains the greatest evil of fortress language 
>> yet. 
>
> I just want to apologize for the fact that we haven't had much
> explicit discussion on this topic so far.  I know it seems as if
> the Fortress team at Sun has just ignored the issue of the best way
> to mark parallel and sequential loops.  It is very much on our minds,
> but it is still not clear what is the best way, so for now we have made
> no change and are concentrating on building a compiler.  But we
> are thinking about the problem in the background.  It may be
> that if we can have better technology in the compiler to detect
> "dangerous" parallel loops, so we could better prevent the bugs,
> then maybe the syntax problem is not as importa! nt.   t figure out 
> better compiler analysis, then suggestions such
> as yours may become much more important to consider.
>
> I think the choice of <- or <= is very cute, very clever, and visually
> appealing, but I worry that it will be too subtle for most programmers
> to notice when reading over code quickly.  Still, it is a possible
> choice to consider in the future.
>
> --Guy Steele
>


Gmane