Getting Started – Scala

Let us start with

  • Brief history of Scala
  • Scala REPL or CLI

Brief History of Scala

Let us understand the history of Scala and also few details about this programming language

  • Scala is JVM based programming language
  • JVM – Java Virtual Machine is the abstraction layer between programming language and underlying operating system
  • Scala programs will be compiled into Java byte code
  • Even though Scala programs compiles into Java byte code – syntactically it is very different from Java
  • Scala’s syntax follow Functional programming paradigm
  • Martin Odersky is the founder of the language
  • It is founded in Year 2001
  • Scala is open source and object oriented
  • Architecture of JVM based programming language

  • List of JVM based programming languages

  • Consolidated view of JVM based programming languages architecture

Scala REPL or CLI

As part of this topic we will understand what REPL is

  • Make sure to set up Scala as per this blog post
  • REPL stands for Read-Evaluate-Print-Loop
  • It is also called as Command Line Interface
    • SQLPLUS
    • Python
    • and many more are traditional examples
  • It is interactive way of validating the code
  • Once you hit enter or control+D in :paste mode, the code will be
    • Read
    • Evaluated (Compiled and run)
    • Printed (output will be printed)
    • Looped (will wait for another code snippet)
  • :help – to get the help of REPL
  • :quit – to quit from REPL
  • :javap – to see metadata of the compiled classes
  • :paste – to come up with multi line code
  • Here are the list of commands available