Easy Tutorial
❮ Scala Collections Functions Default Parameter Values ❯

Scala Introduction

Scala is an acronym for Scalable Language, a multi-paradigm programming language.

Martin Odersky of the Swiss Federal Institute of Technology in Lausanne (EPFL) began designing Scala in 2001 based on his work with Funnel.

Funnel is a programming language that combines functional programming concepts with Petri nets.

Odersky's previous work included Generic Java and javac (Sun Java compiler). Scala for the Java platform was released at the end of 2003/early 2004. Scala for the .NET platform was released in June 2004. The second version of the language, v2.0, was released in March 2006.

As of September 2009, the latest version was 2.7.6. Features expected in Scala 2.8 included a rewritten Scala collections library, named and default parameters for methods, package objects, and Continuation.

In April 2009, Twitter announced that they had migrated most of their backend code from Ruby to Scala, with plans to migrate the rest. Additionally, Wattzon has publicly stated that its entire platform is written on Scala infrastructure.


Scala Features

Object-Oriented Features

Scala is a purely object-oriented language, where every value is an object. The data types and behaviors of objects are described by classes and traits.

There are two ways to extend class abstraction mechanisms: one is through subclass inheritance, and the other is a flexible mixin mechanism. These two approaches can avoid the various issues associated with multiple inheritance.

Functional Programming

Scala is also a functional language, where functions can also be used as values. Scala provides lightweight syntax for defining anonymous functions, supports higher-order functions, allows nesting of multiple levels of functions, and supports currying. Scala's case classes and built-in pattern matching are equivalent to algebraic types commonly used in functional programming languages.

Furthermore, programmers can use Scala's pattern matching to write code similar to regular expressions for processing XML data.

Static Typing

Scala has a type system that ensures the safety and consistency of the code through compile-time checks. The type system specifically supports the following features:

Extensibility

Scala's design is based on the fact that in practice, the development of domain-specific applications often requires domain-specific language extensions. Scala provides many unique language mechanisms that can easily and seamlessly add new language structures in the form of libraries:

Concurrency

Scala uses Actors as its concurrency model, which are thread-like entities that send and receive messages through mailboxes. Actors can reuse threads, so millions of Actors can be used in a program, while only thousands of threads can be created. In versions after 2.10, Akka is used as its default Actor implementation.


Who Uses Scala


Scala Web Frameworks

The following are two of the currently popular Scala web application frameworks:

-

Lift Framework

-

Play Framework

❮ Scala Collections Functions Default Parameter Values ❯