tags:

views:

599

answers:

3

I have been learning Erlang, but also I'm keeping my eyes open to other technologies such as Scala. Does anyone know how Scala's multi node performance compares to Erlang?

+5  A: 

Scala is not designed as a coherent platform (like erlang) and therefore does not include robust distribution capabilities by default. The scala actor library is more like erlang's process model refitted on the language. There are libraries which provide OTP-like capabilities and clustering, i.e. Akka.

Felix Lange
I think Scala is designed to be coherent, just not monolithic, all-encompassing or to cater to a multiplicity of individual, specialized uses.
Randall Schulz
It's a coherent *language* (did you mean that?)
Felix Lange
+12  A: 

[Disclaimer: I'm on the Akka team]

I really encourage you to take a good look at the Scala framework Akka

We really strive to provide a platform that scales horizontally AND vertically, and that embraces failure to enable self-healing systems.

Features: 
   Actors for concurrency
   Software Transactional Memory (STM) for concurrent transactional composition 
   Supervisor hierarchies for fault-tolerance 
   Cluster Membership
   Java API with ActiveObjects (Java Actors sort of)
   Distributed persistence through MongoDB, Cassandra or Redis
   REST support through exposing Actors as JAX-RS endpoints + (Comet/Ajax Push)
   + much much more

Hope to see you on the mailing list soon!

Viktor Klang
Is Akka based on Scala? Is it being used anywhere?
Zubair
Yes, it's written in Scala.As for usage, I only know one company that I'm allowed to "out" about them using it, and that's Flowdock: http://flowdock.com/
Viktor Klang
Is there any good introduction to Akka? I mean, not code snippets, but a good, step-by-step introduction.
F0RR
@F0RR Have you seen http://jonasboner.com/2010/01/04/introducing-akka.html ?
Daniel
@Viktor - is there a document explaining how (and why) I might convert some scala actors to Akka actors? Why do I want to do this? What benefits does Akka bring? Is the conversion simple?
oxbow_lakes
There's no migration guide that I know of, however, it's on our to-do list to make Akka a drop-in replacement for Scala Actors.The benefits are as follows: Performance (currently about 100% faster), Possibility to have transactional actors with STM, supervisor hierarchies, dead-easy remote actors and cluster membership, built-in support for distributed NoSQL storage engines like Cassandra, MongoDB and Redis + much more. Have a look at akkasource.org
Viktor Klang
+5  A: 

Scala is limited somewhat by the fact that Java threads are rather heavy. It won't scale in number of threads as much as Erlang does.

To put it plainly, forget about running thousands of actors in Scala in the short term. EDIT: see comment below to an experience to the contrary. In my defense, I meant thousands of actors on thousands of threads.

However, actors are not part of the base language. They are just a library which, because of Scala's intrinsic strengths, look as if they are part of the language. The importance of that is that actors are replaceable. There are two important alternative actor libraries for Scala. The most famous one is Akka, of which others have spoken about, and which I can only endorse as being worth a serious look at. The other one is Lift's actors, which go the other way, by providing a more simple (and reliable) actor implementation that meets Lift's own needs, and doesn't try to go beyond that.

Another promising development is the addition of delimited continuations to Scala 2.8. Delimited continuations, while difficult to use, enable a very fast actor implementation. Just to be clear, it is difficult to write libraries (such as actors) with delimited continuations, but such library wouldn't be any different to use than the others actor libraries.

Daniel
Daniel - as I've mentioned elsewhere, I have an application which has 25,000 actors and which happily runs on 3 year-old linux blades on top of a thread pool limited to 8 threads
oxbow_lakes