On Fri, 2008-01-11 at 10:34 -0800, Dave Whipp wrote:
> Matthew Walton wrote:
> 
> > I wouldn't agree with that at all. I think of arrays as ordered constructs,
> > so I'd want the default iteration over my array to happen in the order of
> > the indices.
> 
> I guess that depends on whether you think of the array as a list or as a 
> ram. I know that a group at microsoft added a ParallelArray datatype 
> (ftp://ftp.research.microsoft.com/pub/tr/TR-2005-184.pdf) to C# as a way 
> to distinguish the intent (they speed up data-parallel code by compiling 
> it down to your GPU/graphics card). Perl6, being an operator-oriented 
> language, associates the distinction with the operators rather than with 
> the datatype. This is probably a better approach, but it does mean that 
> you need an operator whenever you want to treat the array as 
> data-parallel. (BTW, data-parallel arrays differ from bags in that they 
> have an ordered index that is preserved across unordered operations)

Good point, a parallel operation over a list would let you preserve
ordering but still benefit from concurrency with operations where
iterating in order is irrelevant. Which, come to think of it, covers
quite a lot of cases.

> Of course, it's not necessarily true that "you know" that something is 
> safe -- often "you think" it's safe but then you get an intermittent 
> failure at runtime,. I would love to be able to tell the compiler "I 
> think this is safe" and have it tell me "you're wrong" as a compile-time 
> error (this is one of the things that an explicit type system is good 
> for). But perhaps Perl is too dynamic a language for that.

Well, I was thinking with 'knowing' that something was safe that you'd
figured out that it was free of side effects by studying the behaviour
of everything you use within the relevant routines...

...in the real world, you need the compiler to be able to do some of
that for you I guess.

And Perl 6's optionally explicit type system might be able to express
that sort of thing.

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to