Scala gives you the feeling of an interpreting language. But it’s basically a compiled language, where anything you type is compiled to the byte code, and it runs inside the JVM. It is often the chosen option for very high-performance systems.
James Gosling, Java ‘s father, says, “If I were to select a language to use today other than Java, it would be Scala.”
Scala was first introduced in 2003 in an attempt to create a “Better Java” Scala that combines the object-oriented nature of Java with a functional programming model. Scala code can be compiled into an intermediary form of a different language and then executed in non-Scala environments. Beyond being a cross-platform language, Scala is also interoperable with Java code.
but, for real? why scala?
Scala programming language has become very popular, especially in the field of cloud computing. The functional aspect of Scala makes it ideal for creating domain-specific languages (DSLs). Beyond that, Scala’s interoperability with Java, coupled with the highly functional and scalable nature of the language, has made Scala a fast-growing programming language.
Scala was designed to improve the Java language. Scala code is more informative and concise than Java code. Java is too verbose which make the programming process overwhelming. Scala has been designed to express common programming patterns in an elegant and type-safe manner. Java uses generic typing that can easily be circumvented, making the syntax easier to read and understand.
Frameworks
Akka
Akka is a framework which can be used on the Java Virtual Machine to create highly parallel, distributed and fault-tolerant applications for both Scala and Java. The Actor model method is used to control concurrency in applications.
Play Framework
Scalatra is a free and open-source web application framework written in Scala. Scalatra is an alternative to the Lift, Play!, and Unfiltered frameworks.
Spark
Spark is written in Scala, and it also provide APIs for Java and Python. However, Java does not support an interactive shell with REPL (Read-Evaluate-Print Loop) and Python is a lot slower than Scala in general. Most of the features are available on Scala first and then on the Python port. It’s highly recommended for Spark users to pick up some Scala.
Recommended Reading
JustEnoughScalaForSpark: Git Tutorial, YouTube Presentation, Slide
Making ZIO, Akka and Slick play together nicely
