News for hackers. Stuff that matters.
Re:Scala 2.9.0 final by petervandijck on Thursday May 12, 2011 @06:50PM (#2542670)
Says our lead programmer: "The new parallel collections are amazing!"
Re:Scala 2.9.0 final by kingcub on Thursday May 12, 2011 @10:40PM (#2543324)
This to me is amazing in it's brevity:

  //Uses 4 threads
  (1 to 4).par.foreach(x => /*some long computation*/ }
I'd love to see how other languages can do it more tersely with their standard libraries.
Re:Scala 2.9.0 final by spamizbad on Thursday May 12, 2011 @11:23PM (#2543420)
In python:

  from multiprocessing import Pool
  p = Pool(4) # 4 worker threads
  p.map(somefunc, someiter)
Not sure if this is apples-to-apples. Regardless, I'm always skeptical of the behavior of threaded code, even if it's embarrassingly parallel stuff that is divided among workers.
Re:Scala 2.9.0 final by fauigerzigerk on Friday May 13, 2011 @06:09AM (#2544144)
Unfortunately the multiprocessing module is a lot less efficient in many cases. Scala doesn't have to copy the entire collection across process boundaries or launch the runtime multiple times. (In this particular rather trivial example it doesn't matter much because an Int range is used). I'm afraid Python is losing out in the parallel world due to the GIL as more CPU cores become the norm.
Re:Scala 2.9.0 final by stuntprogrammer on Thursday May 12, 2011 @11:01PM (#2543372)
In haskell you could write something like this: parMap rseq (\x->/some long computation/) [1..4]

using the standard Control.Parallel.Strategies library (use rwhnf instead of rseq unless you are using v3).

Re:Scala 2.9.0 final by wcsun on Thursday May 12, 2011 @08:33PM (#2542961)
nice to hear that. parallel computing is the reason i choose scala.
Re:Scala 2.9.0 final by alnayyir on Thursday May 12, 2011 @10:33PM (#2543312)
> parallel computing is the reason i choose scala.

What?

Re:Scala 2.9.0 final by michaelcampbell on Friday May 13, 2011 @09:47AM (#2544576)
He said, "parallel computing is the reason [he] chose Scala."

That help? ;-)

Re:Scala 2.9.0 final by alnayyir on Friday May 13, 2011 @12:53PM (#2545260)
I don't think said person of discussion understand what parallelism is. :\