DEV Community

Johnathon roy
Johnathon roy

Posted on

introduction and features of scala

Scala is a general-purpose, object-oriented programming language. It provides support to functional programming. It also helps in avoiding bugs in complex applications. In this article, you get to know about Scala and what is Scala used for?

Scala is a programming language invented in the year 2003 by Mr. Martin Odersky and his team. Scala released publicly in 2004 on the Java platform. The name Scala is a blend of scalable and languages. That signifies it designed to grow with the demands of its users.

  1. Scala is a Robust and High-Caliber programming language.
  2. It is also capable to outrun the speed of the fastest existing programming languages.
  3. it’s a compiler-based and a multi-paradigm language. Which makes it compact, fast and efficient.
  4. Scala uses Java Virtual Machine(JVM) for compilation. Firstly Scala Compiler compiles the Scala code and generates the byte code for the same.
  5. After that, it transferred to the Java Virtual Machine to generate the Output. Platforms And Compilers

Scala runs on the Java Platform(JVM). So it is compatible with all the existing Java programs. Even its compatibility with JAVA makes it well-suited to Android development. Because Android applications typically write in Java and translate from Java bytecode into Dalvik bytecode when packaged.

Let’s talk about some Scala compilers:-

Scala.js:-

  1. Scala.js is a Scala compiler.
  2. It compiles to JavaScript.
  3. Scala.js compiler makes it possible to write Scala programs that can run in web browsers and also in Node.js.
  4. The compiler was in development since 2013. But launched in 2015 with the version name(v0.6).

Scala native:-

  1. Scala native is also a Scala compiler.
  2. That mainly targets the LLVM compiler infrastructure to create executable code.
  3. It uses a lightweight managed runtime. Its first release was 0.1 on 14 March 2017.
  4. The motive behind developing scala native is being faster than JIT compilation for the JVM.
  5. It achieved by eliminating the initial runtime compilation of code and also providing the ability to call native routines directly.

Key Features Of Scala

  1. In Scala, there are no static variables or methods. Scala uses singleton object, which is essentially class with only one object in the source file.
  2. Here you don,t require to mention data type and function return type explicitly. Scala is enough smart to deduce the type of data.
  3. In Scala evaluation is lazy by default. Scala evaluates expressions only when they are required.
  4. Scala provides a standard library that includes the actor model. So you can write concurrency control.
  5. Higher-order functions are the function that either takes a function as an argument or returns a function.

let's get some brief about scala how it is different from others. https://codersera.com/blog/what-is-scala-used-for-a-brief-overview/#19--scala-vs-other-languages--

Top comments (0)