Parallel collections (was Re: Exception transparency)

Brian Goetz brian.goetz at oracle.com
Tue Jun 8 09:16:19 PDT 2010


I am all in favor of ideas that work, whatever their provenance.

Of course, an idea that "fits" in Scala or .NET may or may not fit in Java, or 
may require adaptation to fit in Java.  Most ideas discussed here (e.g., 
closures) are not new to Java, but there is still plenty of work to be done 
figuring out how to properly adapt these age-old ideas to Java.

What I'm asking for is that you fill in the details for us for how it might be 
adapted to our needs.  You've found a good idea elsewhere, that's great, and I 
want to hear about it.  It might even be applicable to Java -- even better! 
But language design does not admit to "drive-by" techniques.  Its not enough 
to say "hey, I found a good idea, you should consider it."  (If for no other 
reason than "Views are the way" is vague enough that I might think I 
understand what you are suggesting, but be completely wrong, since "views" 
could describe lots of inconsistently different language features!)

Parallel collections is indeed one of the critical waypoints that we will use 
to identify whether we've done closures "right".  So I'm happy to hear your 
ideas on how we might do that!  Could you be more concrete on how views could 
solve the problem of accommodating both serial and parallel iteration in a 
type-safe way?


On 6/8/2010 12:02 PM, Nathan Bryant wrote:
> That first post was a little rantish, I apologize if it came across as
> if that was my meaning. It wasn't the intent.
>
> As to the statement that I'm "pointing at Scala" with this post: Well,
> Scala hasn't finished parallelizing their collections framework yet. It
> would be just as easy to say that I'm pointing at .NET etc. If these
> ideas worked well there, why not?
>
> -----Original Message-----
> From: Brian Goetz [mailto:brian.goetz at oracle.com]
> Sent: Tuesday, June 08, 2010 11:56 AM
> To: Nathan Bryant
> Cc: Reinier Zwitserloot; lambda-dev at openjdk.java.net
> Subject: Re: Exception transparency
>
>> Views are the way:
>>
>> Iterable.par().forEach()
>> Iterable.seq().forEach()
>
> Rather than just pointing at Scala (and by implication, suggesting that
> our
> effort here is futile (which you basically stated explicitly in your
> first
> post here ("One starts to wonder, why not just move to Scala"))), how
> about
> offering some concrete advice about how these ideas might be adapted to
> Java?
>


More information about the lambda-dev mailing list