Scala is a functional programming language, Scala is developed on top of JVM(Java Virtual Machine) and so it is one of JVM based programming language. In this article we will look into Scala overview, history and features of scala.
Scala has library of Java and as well as its own, we can used java libraries withing Scala program and mix of both works fine on JVM.
A Scala program is saved in .scala file and after compilation it gets converted into .class file which contains bytecodes of the code, this can run on JVM.
History of Scala
Below are few features of Scala:
1) Object oriented
Scala is object oriented programming language, Scala is developed on top of java and it has classes and objects apart from functions and so Scala is object oriented programming language. It supports many OOPS concepts as well.
2) Functional Programming Language
Scala is mainly popular for its functional programming features, Scala has extensive library which supports a lot of functional programming concepts and design principals.
Scala functions may take another functions as input, a function may return another function as output, a variable can hold a function, it has higher order functions (HOD), currying and partial functions.
3) Statically Typed Language
In Scala you don’t need to specify type in many places and also no need to repeat it.
Example: An int variable can be like below and it will automatically interpret that it is of integer type.
var a = 10
4) JVM based language and runs on JVM
Scala is JVM based language and all Scala code is converted in to byte code and .class file from Scala and runs of JVM like java code.
5) Scala can use JAVA libraries along with Scala
A Scala program can use java libraries along with Scala libraries, for example we can use java.util.* package classes in Scala without any problem.
6) Supports concurrency and synchronized processing
Scala supports concurrency, future and synchronized programming as well.
This helps to run multiple threads, parallel processing etc.
Scala vs Java
- Scala and Java both are JVM based languages.
- Both runs on JVM.
- Scala can use java libraries but java can’t do the same.
- Scala is functional and Java is OOP language.
- Scala has traits and similarly java has interface.
- Scala has futures and Akka frameworks for threading and Java has threads, executor and concurrency APIs for multi-threading.
Scala web frameworks
Below are popular web frames works in Scala which can be used to create Web application and MVC architecture.
- Play framework– Play is the most popular web frameworks of Scala.
- Lift framework – Not much popular.
- Bowler framework – Not much popular.
You may study below related articles to continue your Scala journey:
- Scala Basic
- Scala Data Types
- Scala Variable
- Scala Classes and Objects