What is Scala?
Scala is a general-purpose, high-level, multi-paradigm programming language. It is a pure object-oriented programming language which also provides the support to the functional programming approach. There is no concept of primitive data as everything is an object in Scala. It is designed to express the general programming patterns in a refined, succinct, and type-safe way. Scala programs can convert to bytecodes and can run on the JVM(Java Virtual Machine). Scala stands for Scalable language. It also provides the Javascript runtimes. Scala is highly influenced by Java and some other programming languages like Lisp, Haskell, Pizza, etc.
Evolution of Scala: Scala was designed by the Martin Odersky, professor of programming methods at École Polytechnique Fédérale de Lausanne (EPFL) in Switzerland and a German computer scientist. Martin Odersky is also the co-creator of javac (Java Compiler), Generic Java, and EPFL’s Funnel programming language. He started to design the Scala in 2001. Scala was first released publicly in 2004 on the Java platform as its first version. In June 2004, Scala was modified for the .Net Framework. Soon it was followed by second version i.e. (v2.0) in 2006. At JavaOne conference in 2012, Scala was awarded as the winner of the ScriptBowl contest. From June 2012, Scala doesn’t provide any support for .Net Framework. The latest version of scala is 2.12.6 which released on 27-Apr-2018.
Why Scala?
Scala has many reasons for being popular among programmers. Few of the reasons are :
Note: People always thinks that Scala is a extension of Java. But it is not true. It is just completely interoperable with Java. Scala programs get converted into .class file which contains Java Byte Code after the successful compilation and then can run on JVM(Java Virtual Machine).
Recommended by LinkedIn
Beginning with Scala Programming
Finding a Compiler: There are various online IDEs such as GeeksforGeeks IDE, Scala Fiddle IDE, etc. which can be used to run Scala programs without installing.
Programming in Scala: Since the Scala is a lot similar to other widely used languages syntactically, it is easier to code and learn in Scala. Programs can be written in Scala in any of the widely used text editors like Notepad++, gedit, etc. or on any of the text-editors. After writing the program, save the file with the extension .sc or .scala.
For Windows & Linux: Before installing the Scala on Windows or Linux, you must have Java Development Kit(JDK) 1.8 or greater installed on your system. Because Scala always runs on Java 1.8 or above. In this article, we will discuss how to run the Scala programs on online IDE’s.
Example : A simple program to print Hello Geeks! using object-oriented approach.