Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Scala scale better than other JVM languages?

Here is the only way I know to ask it at the moment. As Understand it Scala uses the Java Virtual Machine. I thought Jruby did also. Twitter switched its middleware to Scala. Could they have done the same thing and used Jruby?

Could they have started with Jruby to start with and not had their scaling problems that caused them to move from Ruby to Scala in the first place? Do I not understand what Jruby is? I'm assuming that because Jruby can use Java it would have scaled where Ruby would not.

Does it all boil down to the static versus dynamic types, in this case?

like image 249
johnny Avatar asked Jun 03 '09 16:06

johnny


People also ask

Why is Scala better than other languages?

Advantages of ScalaThe code is more concise, readable, and error-free. It is easy to write, compile, debug, and run the program in Scala, when compared to many other programming languages. Functional programming lets you approach the same problem in a different angle.

Is Scala more efficient than Java?

The study concluded that Scala was faster than Java and Go when average developers write their code without thinking about optimization too much. The study used the default, idiomatic data structures in each language.

Why is Scala preferred over Java?

The Advantages of ScalaScala has an exact syntax, eliminating boilerplate code. Programs written in Scala require less code than similar programs written in Java. It is both an object-oriented language and a functional language. This combination makes Scala the right choice for web development.

What is the best JVM language?

Scala easily ranks higher than other JVM languages 2019 due to features such as pattern matching, algebraic data types, lazy computation and better support for immutability.


1 Answers

Scala is "scalable" in the sense that the language can be improved upon by libraries in a way that makes the extensions look like they are part of the language. That's why actors looks like part of the language, or why BigInt looks like part of the language.

This also applies to most other JVM languages. It does not apply to Java, because it has special treatment for it's basic types (Int, Boolean, etc), for operators, cumbersome syntax that makes clear what is built in the language and what is library, etc.

Now, Scala is more performatic than dynamic languages on the JVM because the JVM has no support for them. Dynamic languages on JVM have to resort t reflection, which is very slow.

like image 85
Daniel C. Sobral Avatar answered Oct 04 '22 10:10

Daniel C. Sobral