Scala Reactive Programming
上QQ阅读APP看书,第一时间看更新

Introduction to Scala

Scala stands for Scalable language. Scala is a multi-paradigm programming language built on JVM by the Lightbend (formerly known as Typesafe) team. In Scala, it is easy to write concurrent parallel, distributed, and Reactive applications in a concise, elegant, and type-safe way.

Unlike Java, Scala is a pure OOP and FP language. Java is not a pure OOP language because of the following:

  • It supports static members
  • It supports primitive data types

Scala does not support static members. Then how do we define utility methods in Scala? We will explore those in the upcoming sections. In Scala, everything is an object only. There are no primitive types in Scala.

Both Scala and Java programming languages run on JVM:

From Java 8 onward, we can write functional-style programming in Java. However, it does not support all FP features.

Scala's latest stable version is 2.12.3. We will use this version to develop our applications.

We can find the Scala Language API at http://www.scala-lang.org/api/current/index.html.

Scala supports strongly-typed systems, that is, it supports type-safety. Scala is a hybrid programming language that supports both OOP and FP.

The following diagram shows that Scala supports hybrid programming paradigms: