Scala - Overview
Scala, short for Scalable Language, is a hybrid functional programming language. It was created by Martin Odersky and it was first released in 2003.
Scala smoothly integrates features of object-oriented and functional languages and Scala is compiled to run on the Java Virtual Machine. Many existing companies who depend on Java for business critical applications are turning to Scala to boost their development productivity, applications scalability and overall reliability.
Here are the important list of features which makes Scala a first choice of the application developers.
Scala is object-oriented:
Scala is a pure object-oriented language in the sense that every value is an object. Types and behavior of objects are described by classes and traits which will be explained in subsequent chapters.
Classes are extended by subclassing and a flexible mixin-based composition mechanism as a clean replacement for multiple inheritance.
Scala is functional:
Scala is also a functional language in the sense that every function is a value and because every value is an object so ultimately every function is an object.
Scala provides a lightweight syntax for defining anonymous functions, it supports higher-order functions, it allows functions to be nested, and supports currying. These concepts will be explained in subsequent chapters.
Scala is statically typed:
Scala, unlike some of the other statically typed languages, does not expect you to provide redundant type information. You don't have to specify a type in most cases, and you certainly don't have to repeat it.
Scala runs on the JVM:
Scala is compiled into Java Byte Code which is executed by the Java Virtual Machine (JVM). This means that Scala and Java has a common runtime platform. You can easily move from Java to Scala.
The Scala compiler compiles your Scala code into Java Byte Code which can then be executed by the scala command. The scala command is similar to the java command, in that it executes your compiled Scala code.
Scala can Execute Java Code:
Scala enables you to use all the classes of the Java SDK's in Scala, and also your own, custom Java classes, or your favourite Java open source projects.
Scala vs Java:
Scala has a set of features which differ from Java. Some of these are:
All types are objects.
Functions are objects.
Domain specific language (DSL) support.
Concurrency support inspired by Erlang.
Scala Web Frameworks:
Scala is being used every where and importantly in enterprise web applications. You can check few of the most popular Scala web frameworks: