How does parallel processing in Scala "rock"? Can you point me to studies where Actors outperform, say OpenMP or Task Parallel Library? Does parallel processing on Scala compensate the overhead that Scala generally has over Java, C++, or in this case C#?
I'd seriously like to know. I know that actors are good in some situations (distributed computing where you would normally use message passing), but statements such as the above can often be heard, but seem far to broad.
Actually, in this case I was mostly referring to the parallel and distributed collections. And stuff like coding a for comprehension that can be transparently spread over multiple cores or even boxes.
I don't know enough about the actors stuff to make a good statement about it.
Why and how should actors outperform OpenMP or TPL? They serve completely different goals.
Scala ships by default with sequential, lazy and parallel collections and actors.
Akka (akka.io) provides a different implementation of actors (which will replace the one in the standard library in the future), as well as Agents, STM, Transactors, ... for all your concurrency needs. Akka actors can actually outperform Erlang actors in core areas.
Spark (spark-project.org) provides a (Hadoop-like) framework for distributed collections.
Work is being done to make Scala collections run on GPUs, too.
I would argue that Scala's toolbox is pretty diverse and complete when dealing with parallel and/or concurrent problems.
Without facts I wouldn't claim that Scala is slower than Java/C++/C#.
Scala beats the shit out of Java in situations where Java has to work with boxed types instead of primitives like in ArrayList<Integer>, enables people to write fully generic algorithms supporting any number type without speed penalty.
Scala is certainly nicer than C++ because it just works and has far less weird corners or surprises. It lets you write code faster and gives you more time to actually optimize those places where it matters.
C# is pretty much a kitchen-sink language with many features bolted on in a non-othogonal way, unlike Scala. The unreliable VM doesn't help, although value types and the thing Mono did with SIMD is certainly nice.
Why and how should actors outperform OpenMP or TPL? They serve completely different goals.
Show us numbers. That was the main request of my comment, and you come with a list of libraries? We hear all the time how great Scala is with respect to parallel computing. Show me some good examples, where it beats C++ or C# with TPL, say doing number crunching.
It's all to easy to repeat a mantra (parallel programming in Scala rocks), but it has been proven correct rarely. Given such statements, I would either expect it to be much easier to parallelize programs in Scala (as opposed to, say, adding OpenMP pragmas) or would expect parallelized programs to be much faster. Neither seem to be true.
First, I am reacting to the original commenter, and pointing out that your post does not answer my question to the original commenter.
Second, I do know the difference between concurrency and parallelism (since I use the latter a lot, and the former in the rare occasion of writing GUI programs). Anyway, your ad hominems do not serve the discussion.
Third, mentioning 'actors' and OpenMP is one sentence was poking a bit of fun at the overly broad statements often made by fans of Scala (and Erlang) about what Actors will do. But the next time I will leave my sardonicism at the door.
I'd seriously like to know. I know that actors are good in some situations (distributed computing where you would normally use message passing), but statements such as the above can often be heard, but seem far to broad.