Scala, higher level of language in Java virtual machine

Created by the LAMP group at the Federal Polytechnic School of Lozan (EPFL) under the guidance of Professor Martin Odersky, The Rock is a universal programming language designed to provide short and simple code. It is close to Java with borrowings from various other languages, but also brings innovations and simplifications, which makes you think about JavaScript. This results in slow compilation.
It is based on domain-oriented programming no less than functional languages. According to the authors, Scala code is two to three times more concise than equivalent code in Java. But you can also write such unreadable code as Perl's. Like Perl, it allows you to do the same in very different ways.
The code can be compiled in Java or .NET bytecode and is compatible with their respective runtimes. In February 2015, the Scala.js compiler in JavaScript was declared suitable for use in production.

The word scala is short for SCAlable LAnguage and also means ladder in Italian, symbolizing multi-level programming.

The scalac compiler is BSD licensed. Since 2014, leading compiler developers have been working on a new language - Dotty, a simplified version of Scala, which should remove intractable problems to improve this compiler.

Le language de programmation Scala

March 14, 2017 Scala Native is announced. (Article in English). We are talking about replacing the Java virtual machine with LLVM and, therefore, creating executable binaries. A full library is attached to this, but Java is still required to run.

In May 2021, Scala 3 arrives, offering simplicity in syntax. You can write code with indentation, as Python does instead of hugging. Now it is optional, but you can always use the classic syntax.

Characteristics of the Rock

You should be aware that many elements of the language, such as return or for, for example, do not work as is customary in previous languages .

Syntax and constructs:

Other possibilities:

Example code in Scala, show "Hello world!":

object HelloWorld {
  def main(args: Array[String]) {
    println("Salut le Monde!")
  }
}

Define class:

class voiture(vitesse:Integer, nom:String) {
   ... corps du constructeur et de la classe ...
}

Why use the Rock

?

Scala contributes to the gradual evolution of programs over time.
Scala code can easily interact with pre-existing Java code. It is actually compiled in Java bytecode. Thus, both languages ​ ​ can be used in the same program, since Scala provides, in particular, the advantage of greater brevity.
Scala makes XML documents easy to process.

Social site Twitter ditched the Ruby language for the backend and programmed its services on Scala to take advantage of the evolutionary nature of the language. The site gradually builds an audience and offers new services over time, hence the need for language to facilitate the expansion of programs without rewriting them .

Tools and documents