4 ms·
Groovy is one of the best kept secrets of the JVM scripting world. I hardly _ever_ write pure Java if I can do it in Groovy instead. Look at how insanely easy
by laichzeit0 12y ago
Groovy is one of the best kept secrets of the JVM scripting world. I hardly _ever_ write pure Java if I can do it in Groovy instead. Look at how insanely easy parallel programming is in Groovy using gpars: http://gpars.codehaus.org/ http://gpars.codehaus.org/
It's literally:
GParsPool.withPool {
def result = [1, 2, 3, 4, 5].collectParallel {it * 2}
}
Why oh why people still torture themselves with pure Java.
- pjmlp 12y ago> Why oh why people still torture themselves with pure Java. Customer requirements.
- raiph 12y agoAn equivalent in P6: [1,2,3,4,5] X* 2 This (theoretically) parallel processes and then puts the results back in order. The X is the cross metaoperator; it applies the following operator (the * symbol which is the multiply operator) to each of the combinations of the items in the lists on its left and right, and does so in parallel if the compiler so chooses, and ensures the results are returned as if it was processed sequentially.