On 01/15/2015 03:24 PM, Thomas Neidhart wrote:
On 01/08/2015 12:34 PM, Gilles wrote:
Hi.

Raising this issue once again.
Are we going to upgrade the requirement for the next major release?

   [ ] Java 5
   [x] Java 6
   [x] Java 7
   [ ] Java 8
   [ ] Java 9

A while ago I thought that it would be cool to switch to Java 7/8 for
some of the nice new features (mainly fork/join, lambda expressions and
diamond operator, the rest is more or less unimportant for math imho).

But after some thoughts I think they are not really needed for the
following reasons:

  * the main focus of math is on developing high-quality, well tested and
documented algorithms, the existing language features are more than
enough for this

  * coming up with multi-threaded algorithms might be appealing but it is
also hard work and I wonder if it really makes sense in the times of
projects like mahout / hadoop / ... which aim for even better scalability
Creating thread safe classes / algorithms has traditionally been "Tricky".  
With Java 8 parallel streams processing concurrency is a lower hanging fruit.  For 
example (Taken from http://winterbe.com/posts/2014/07/31/java8-stream-tutorial-examples/):

|=================================

Integer  ageSum  =  persons
    .parallelStream()
    .reduce(0,
        (sum,  p)  ->  {
            System.out.format("accumulator: sum=%s; person=%s\n",  sum,  p);
            return  sum  +=  p.age;
        },
        (sum1,  sum2)  ->  {
            System.out.format("combiner: sum1=%s; sum2=%s\n",  sum1,  sum2);
            return  sum1  +  sum2;
        });

// accumulator: sum=0; person=Pamela
// accumulator: sum=0; person=David
// accumulator: sum=0; person=Max
// accumulator: sum=0; person=Peter
// combiner: sum1=18; sum2=23
// combiner: sum1=23; sum2=12
// combiner: sum1=41; sum2=35
|
|=================================

Less boilerplate, easier to read code, that's more efficient.  Java 8 
encourages making use of the fluid functional programming internally that
that the newer APIs aim to provide "Externally".
|

Cheers,
Ole

Reply via email to