If you want an academic viewpoint, read this paper. If you are thinking about Scala, read Odersky and friends’ overview where they discuss what makes Scala scalable. There’s also a related question.
In a nutshell, Scala has features such as operator overloading, user-defined classes, traits, and many others, that allow one to express many domain-specific problems in a very natural way.
Answer from Ray Toal on Stack ExchangeFor building large-scale systems (scalable systems) what would be your preferred programming language of choice?
What back-end language would you choose to build a fast, scalable site?
Does scalability depend on programming language? - Stack Overflow
SO - How do you pronounce "Scala"?
Videos
If you want an academic viewpoint, read this paper. If you are thinking about Scala, read Odersky and friends’ overview where they discuss what makes Scala scalable. There’s also a related question.
In a nutshell, Scala has features such as operator overloading, user-defined classes, traits, and many others, that allow one to express many domain-specific problems in a very natural way.
There is no such thing as a scalable language. Every language to date fails in some regard.
Does the program support libraries written in that language?
Pascal exemplifies this problem. not scalable in this sense.Is the language consistent?
Visual Basic is not scalable in this sense. Visual Basic is an outlier in this sense in that it consistently exhibits an utter lack of consistency. Operating overloading in C++ and other languages is a nice feature, but also a misfeature when the overload is inconsistent with the base meaning (e.g.std::isteam::operator>>).Is the language stable?
A program written 20 years ago in Fortran or Lisp has a good chance of being compilable and runnable today. Python and scala are not scalable in this sense. Upgrade to the latest and greatest and you may well break code that was written last week.Is the language widely accessible?
The first computers were programmed at the bit level (ENIAC) or machine level (UNIVAC-1). Six women were capable of programming the ENIAC. Those six women have been recognized by multiple organizations for this incredible feat. A modern day large-scale complex of programs is written by people with varying levels of programming skill. A language that requires an advanced degree in computer science is not scalable. Lisp, for example, is a beautiful language that has pretty much languished in academia because it is not accessible to the masses.Does the language support strings?
Good luck writing a parser in Fortran.Does the language support numerical processing?
Good luck writing a scientific program in Cobol. Diehard Fortran programmers reject C (and C++, and Java, and ...) because in their minds nothing comes close to Fortran when it comes to scientific programming. For this reason, a lot of the scientific libraries provided by non-Fortran languages are simply wrappers around Fortran libraries rather than ports of the Fortran implementations to the target language.Is the language applicable to a wide scale of problems?
The above two questions are specializations of this broader question. The original general-purpose languages, Fortran, Lisp, and Cobol. were anything but general purpose.Does the language perform well?
Good luck writing a simulation of a galaxy in python or scala. The answer might come back when the universe ends. Performance doesn't matter, until it does matter. When it does matter, performance can be paramount. A language that shuns addressing performance issues is not scalable.Does the language invite bad programming techniques?
Perl invites programmers to write write-only code. FORTRAN (Fortran much less so) invited programmers to write spaghetti code. Modern languages invite programmers to hide the spaghetti with constructs such as exceptions and breaks, but it's still old-style spaghetti. There's also spaghetti inheritance in C++ and Smalltalk, spaghetti call trees in languages where a ten line function is viewed as being too long. And of course holey lasagna, leaky ravioli, and a host of other kinds of bad pasta code. These misfeatures argue against scalability.Is the language a good language for authoring legacy code?
Far too many large projects find they need to hire an ex-employee as a consultant because the original author is the only person who has even the slightest chance of understanding the code. A language that is good for authoring legacy systems is not a good choice as a scalable language.Is the language safe?
Large systems are inevitably written by people who somehow manage to find all of the flaws in the implementation language. Project managers of a large, complex system can choose from two classes of people to author the system: Computer scientists who are clueless of the problem domain or domain experts who are clueless about how to write code well. They can't use people who can live in both worlds because such people are few in number and would destroy the company's pay scale. A scalable language has to be safe with regard to the domain and with regard to computer science constructs. Such a language does not exist.
Say you wanted to build the next Twitter or Facebook. Which primary back-end language would you choose, and why?
If you'd pick a language I haven't listed, like Elixir or something, please mention it in the comments.
(Java and C# are combined into one option because I can only have 6 options, and those languages are pretty similar.)
This seems to be a typical instance of conflating coincidence and causality. Twitter changed their architecture, which solved their scalability problems. At the same time, they also happened to introduce a new programming language, but this doesn't mean that this was responsible for fixing their problems.
Twitter was originally envisioned as a CMS platform. So, it was architected as a CMS, with a database at the center. However, users didn't use it as a CMS, they used it as a messaging platform. A database is pretty much the worst case scenario for a messaging platform: a messaging platform needs a message queue at the center. So, Twitter wrote a message queue that complements their database, and that helped their scalability problems somewhat.
This message queue was actually written in Ruby. So, no Scala there. (BTW: the name of the language is Scala, not SCALA. It's not an acronym.)
This first message queue also had scalability problems. Not because it was written in Ruby, but because it was the first time that any of the developers had ever written a message queue. So, they wrote another message queue. This time, they had all the experience from the first message queue, so this one was better. And it happened to be written in Scala.
The reason why Twitter had scalability problems at the beginning was not because of Ruby, it was because there had never been a Twitter before, and nobody knew how to scale it.
The reason why it scales now, is because they learned how to scale it, not because of Scala. (In fact, large parts of Twitter are still implemented in Ruby. Others are in C++, and there's some Erlang, too, I believe.)
Architecture scales. Good languages can make it easier to find performance and scalability bottlenecks (by simply having less code to look through), and make it easier to do large scale architecture refactoring (again: less code), but ultimately, it's about the architecture.
one simple counterexample: writing a web server in Assembly is for all practical purpose impossible.
However, I doubt that the reason for the shift is because Scala is more scalable than Ruby. I would expect both language to have similar scalability factor. The only reason I can think of why they want to move to Scala is probably to benefit from Java Virtual Machine; Java VM is very well-tuned and fast. All the while, Scala has a more expressive syntax than Java, and is generally a nicer language.