Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Scala is billed as a scalable language, a feature that's even included in its name:

The name Scala is a portmanteau of "scalable" and "language", signifying that it is designed to grow with the demands of its users.

What does "scalable" mean in the context of Scala? What makes Scala more scalable than, say, Java?

share
5  
Scala ain't scalable in the way you think: you really should read the Twitter developers interview about Scala/Java... Basically every time they had (real) scalability issues, they ended up removing Scala code and putting in correctly multi-threaded Java code (which, as has been pointed out here, is much easier to do in Java than in Scala). Scala is cool for proto-typing and writing unit tests and anything that doesn't involve "Real World" [TM] amount of data that said. –  Tristan St. Nov 29 '10 at 22:16
5  
It's easier to write correctly multi-threaded code in Java than in Scala? how so? –  Aaron Novstrup Nov 30 '10 at 1:45
    
@Webinator Do you have a link to the interview? –  Aaron Novstrup Nov 30 '10 at 1:48
    
Agree with Tristan St on scalability. Erlang is the leader of the pack in case of concurrent programming due to its ability to create processes in a minimal time. You just can't create 10000+ plus threads and interact it with each other in SCALA in the way as your think. –  Ubermensch Jan 16 '12 at 7:11
3  
@TristanSt. Nice spreading of FUD, that's absolutely not the basic take away I got from that interview. - "But for other parts we’ve just gone back to a traditional Java threading model. The engineer working on that, John Kalucki, just found it was a little bit easier to test, a bit more predictable. The nice thing was, it took minutes to switch code that was actor based over to something thread based. It was a couple of search and replaces. So it’s not so bad if actors fail you for whatever reason." Amazing concept - some things suite the actor model and some don't! –  Derek Litz Mar 17 '12 at 15:52
comments disabled on deleted / locked posts

migration rejected from stackoverflow.com Oct 14 '13 at 22:15

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as primarily opinion-based by gnat, MichaelT, Ozz, Kilian Foth, Robert Harvey Oct 14 '13 at 22:15

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

4 Answers

up vote 14 down vote accepted

When Martin Odersky talks about scala as a scalable language choice, what he means is that the language itself is appropriate for:

  • scripting stuff
  • writing applications
  • writing monster "enterprise" (for the want of a better word) applications

He is most certainly not referring to scalability from the perspective of performance!

The fact that he can claim that scala is as appropriate for quick'n'dirty scripting as it is for large-scale enterprise deployment is roughly as follows:

Scripting

Scala is great for scripting because its type inference and functional style make it both concise and great for slicing and dicing collections etc.

Applications

Scala is great for writing applications because it is a statically type checked language with some great features for working in both functional and imperative styles. Scala is compatible with Java and hence you can leverage an enormous ecosystem of libraries.

Enterprise Deployment

Scala compiles to bytecode and runs on the Java Virtual Machine, a stable system with great performance, when compared to (so-called) dynamically typed (i.e. untyped) languages. Again, the fact that it is statically typed means that refactoring is made much easier on large codebases.

share
locked by Community Oct 14 '13 at 22:15
    
Any supporting evidence for "statically typed means that refactoring is made much easier on large codebases"? Sounds more like a, "it depends", situation then a fact. The only thing I've seen typed languages offer definitively is they are easier for compiler writers to deal with. –  Derek Litz Mar 17 '12 at 15:22
comments disabled on deleted / locked posts

What Odersky says is (Slide 11, http://www.slideshare.net/rawwell/scalaliftoff2009pdf):

"Scala is deep where other languages are broad."

This means, scalable is meant in terms of flexibility and expressiveness. You can create your own control structures. E.g. the actors frameworks is a library, but it looks like it uses language features.

This means that Scala will scale according to the needed abstraction, not necessarily in terms of "answering 1.000.000 requests in a second" (but Scala is here strong, too).

share
locked by Community Oct 14 '13 at 22:15
1  
+1 this really fits with "SCAlable LAnguage". It is a language that is designed to grow with the developer's needs. –  Ben James Nov 29 '10 at 13:30
comments disabled on deleted / locked posts

What limits Java's scalability in practice is not the JVM, it's the difficulty of writing correct concurrent code. Scala makes this easier through its support for functional programming, and the actor model.

Java can be very scalable when concurrency is easy, such as in web servers (each request is almost completely independant). But when it comes to parallelizing a single long-running task, it can be a real struggle to get right.

share
locked by Community Oct 14 '13 at 22:15
    
While Java doesn't have support for functional programming, this doesn't mean you can't use it in Java. Doing so can give you much the same scalability, though for more effort. A library which can help code.google.com/p/lambdaj –  Peter Lawrey Nov 29 '10 at 13:29
2  
The Scalability to which Scala owns its name is of the language, not of programs. –  Daniel C. Sobral Nov 29 '10 at 14:30
comments disabled on deleted / locked posts

That's not necessary the language itself that is more scalable than Java, as you say both languages can produces same bytecode.

But the Actor model and functional programming style can enhance scalability (by -in a nutshell- simplifying correct concurrency programming and reducing synchronization needs).

To get a better insight take a look at the actor model and compare it with traditional multi-threaded java application:

You can even use the Akka framework to create highly scalable Java application without coding in Scala:

share
locked by Community Oct 14 '13 at 22:15
    
The actors library is a good example of how Scala is scalable, but this example is not to do with concurrency: the actors API looks like a native feature with special operators (such as the ! message-send), yet really it is all just regular method calls. –  Ben James Nov 29 '10 at 13:39
    
Actor model help you to write scalable software without too much pain and without too much concurrency headache, isn't it ? so even if you don't see it when using Actors, concurrency as something to do with the actor model. Actor model aim to simplify concurrent computation, so why this example has nothing to do with concurrency ... I don't get your point here ? –  Alois Cochard Nov 29 '10 at 14:01
    
My comment was not brilliantly worded, sorry. llemieng's or michael.kebe's answers explain it better. –  Ben James Nov 29 '10 at 14:58
    
No problem ! I now understand your point, I was only speaking about Scala libraries scalability and not about the language scalability/concurrency features itself. Thanks –  Alois Cochard Nov 29 '10 at 15:24
comments disabled on deleted / locked posts

Not the answer you're looking for? Browse other questions tagged or ask your own question.