请输入您要查询的百科知识:

 

词条 Scala (programming language)
释义

  1. History

  2. Platforms and license

      Other compilers and targets  

  3. Examples

      "Hello World" example    Basic example    Example with classes  

  4. Features (with reference to Java)

      Syntactic flexibility    Unified type system    For-expressions    Functional tendencies    Everything is an expression    Type inference    Anonymous functions    Immutability    Lazy (non-strict) evaluation    Tail recursion    Case classes and pattern matching    Partial functions    Object-oriented extensions    Expressive type system    Type enrichment  

  5. Concurrency

  6. Cluster computing

  7. Testing

  8. Versions

  9. Comparison with other JVM languages

  10. Adoption

      Language rankings    Companies  

  11. Criticism

  12. See also

  13. References

  14. Further reading

{{Infobox programming language
| name = Scala
| logo =
| paradigm = Multi-paradigm: concurrent, functional, imperative, object-oriented
| designer = Martin Odersky
| developer = Programming Methods Laboratory of École Polytechnique Fédérale de Lausanne
| typing = Inferred, static, strong, structural
| influenced = Ceylon, Fantom, F#, Kotlin, Lasso, Red
| platform = JVM, JavaScript,[1] LLVM[2] (experimental)
| license = Apache License 2.0[3]
| website = {{URL|https://www.scala-lang.org}}
| wikibooks = Scala
| year = {{Start date and age|2004|01|20|df=yes}}
| programming_language = Scala
| latest_release_version = 2.12.8
| latest_release_date = {{Start date and age|2018|12|04|df=yes}}[4]
| influenced_by = Common Lisp,[5] Eiffel, Erlang, Haskell,[6] Java,[7] OCaml,[7] Oz, Pizza,[8] Scheme,[7] Smalltalk, Standard ML[7]
| file_ext = .scala, .sc
}}Scala ({{IPAc-en|ˈ|s|k|ɑː|l|ɑː}} {{respell|SKAH|lah}})[9] is a general-purpose programming language providing support for functional programming and a strong static type system. Designed to be concise,[10] many of Scala's design decisions aimed to address criticisms of Java.[8]

Scala source code is intended to be compiled to Java bytecode, so that the resulting executable code runs on a Java virtual machine. Scala provides language interoperability with Java, so that libraries written in either language may be referenced directly in Scala or Java code.[11] Like Java, Scala is object-oriented, and uses a curly-brace syntax reminiscent of the C programming language. Unlike Java, Scala has many features of functional programming languages like Scheme, Standard ML and Haskell, including currying, type inference, immutability, lazy evaluation, and pattern matching. It also has an advanced type system supporting algebraic data types, covariance and contravariance, higher-order types (but not higher-rank types), and anonymous types. Other features of Scala not present in Java include operator overloading, optional parameters, named parameters, and raw strings. Conversely, a feature of Java not in Scala is checked exceptions, which have proved controversial.[12]

The name Scala is a portmanteau of scalable and language, signifying that it is designed to grow with the demands of its users.[13]

History

The design of Scala started in 2001 at the École Polytechnique Fédérale de Lausanne (EPFL) (in Lausanne, Switzerland) by Martin Odersky. It followed on from work on Funnel, a programming language combining ideas from functional programming and Petri nets.[14] Odersky formerly worked on Generic Java, and javac, Sun's Java compiler.[14]

After an internal release in late 2003, Scala was released publicly in early 2004 on the Java platform,[15][8][14][16] A second version (v2.0) followed in March 2006.[8]

On 17 January 2011, the Scala team won a five-year research grant of over €2.3 million from the European Research Council.[17] On 12 May 2011, Odersky and collaborators launched Typesafe Inc. (later renamed Lightbend Inc.), a company to provide commercial support, training, and services for Scala. Typesafe received a $3 million investment in 2011 from Greylock Partners.[18][19][20][21]

Platforms and license

Scala runs on the Java platform (Java virtual machine) and is compatible with existing Java programs.[15] As Android applications are typically written in Java and translated from Java bytecode into Dalvik bytecode (which may be further translated to native machine code during installation) when packaged, Scala's Java compatibility makes it well-suited to Android development, more so when a functional approach is preferred.[22]

The reference Scala software distribution, including compiler and libraries, is released under the Apache license.[23]

Other compilers and targets

Scala.js is a Scala compiler that compiles to JavaScript, making it possible to write Scala programs that can run in web browsers.[24]

Scala Native is a Scala compiler that targets the LLVM compiler infrastructure to create executable code that uses a lightweight managed runtime, which uses the Boehm garbage collector. The project is led by Denys Shabalin and had its first release, 0.1, on 14 March 2017. Development of Scala Native began in 2015 with a goal of being faster than just-in-time compilation for the JVM by eliminating the initial runtime compilation of code and also providing the ability to call native routines directly.[25][26]

A reference Scala compiler targeting the .NET Framework and its Common Language Runtime was released in June 2004,[14] but was officially dropped in 2012.[27]

Examples

"Hello World" example

The Hello World program written in Scala has this form:

 object HelloWorld extends App {   println("Hello, World!") }

Unlike the stand-alone Hello World application for Java, there is no class declaration and nothing is declared to be static; a singleton object created with the object keyword is used instead.

When the program is stored in file HelloWorld.scala, the user compiles it with the command:

and runs it with

This is analogous to the process for compiling and running Java code. Indeed, Scala's compiling and executing model is identical to that of Java, making it compatible with Java build tools such as Apache Ant.

A shorter version of the "Hello World" Scala program is:

println("Hello, World!")

Scala includes interactive shell and scripting support.[28] Saved in a file named HelloWorld2.scala, this can be run as a script with no prior compiling using:

Commands can also be entered directly into the Scala interpreter, using the option {{mono|-e}}:

Expressions can be entered interactively in the REPL:

$ scala

Welcome to Scala 2.12.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_131).

Type in expressions for evaluation. Or try :help.

scala> List(1, 2, 3).map(x => x * x)

res0: List[Int] = List(1, 4, 9)

scala>

Basic example

The following example shows the differences between Java and Scala syntax:

// Java:

int mathFunction(int num) {

    int numSquare = num*num;    return (int) (Math.cbrt(numSquare) +      Math.log(numSquare));

}

// Scala: Direct conversion from Java

// no import needed; scala.math

// already imported as `math`

def mathFunction(num: Int): Int = {

  var numSquare: Int = num*num  return (math.cbrt(numSquare) + math.log(numSquare)).    asInstanceOf[Int]

}

// Scala: More idiomatic

// Uses type inference, omits `return` statement,

// uses `toInt` method, declares numSquare immutable

import math._

def mathFunction(num: Int) = {

  val numSquare = num*num  (cbrt(numSquare) + log(numSquare)).toInt

}

Some syntactic differences in this code are:

  • Scala does not require semicolons to end statements.
  • Value types are capitalized: Int, Double, Boolean instead of int, double, boolean.
  • Parameter and return types follow, as in Pascal, rather than precede as in C.
  • Methods must be preceded by def.
  • Local or class variables must be preceded by val (indicates an immutable variable) or var (indicates a mutable variable).
  • The return operator is unnecessary in a function (although allowed); the value of the last executed statement or expression is normally the function's value.
  • Instead of the Java cast operator (Type) foo, Scala uses foo.asInstanceOf[Type], or a specialized function such as toDouble or toInt.
  • Instead of Java's import foo.;, Scala uses import foo._.
  • Function or method foo() can also be called as just foo; method thread.send(signo) can also be called as just thread send signo; and method foo.toString() can also be called as just foo toString.

These syntactic relaxations are designed to allow support for domain-specific languages.

Some other basic syntactic differences:

  • Array references are written like function calls, e.g. array(i) rather than array[i]. (Internally in Scala, the former expands into array.apply(i) which returns the reference)
  • Generic types are written as e.g. List[String] rather than Java's List<String>.
  • Instead of the pseudo-type void, Scala has the actual singleton class Unit (see below).

Example with classes

The following example contrasts the definition of classes in Java and Scala.

// Java:

public class Point {

  public Point(final double x, final double y) {    this.x = x;    this.y = y;  }
  public Point(    final double x, final double y,    final boolean addToGrid  ) {    this(x, y);
    if (addToGrid)      grid.add(this);  }
  public Point() {    this(0.0, 0.0);  }
  public double getX() {    return x;  }
  public double getY() {    return y;  }
  double distanceToPoint(final Point other) {    return distanceBetweenPoints(x, y,      other.x, other.y);  }
  static double distanceBetweenPoints(      final double x1, final double y1,      final double x2, final double y2  ) {    return Math.hypot(x1 - x2, y1 - y2);  }

}

// Scala

class Point(

    val x: Double, val y: Double,    addToGrid: Boolean = false

) {

  if (addToGrid)    grid.add(this)
  def distanceToPoint(other: Point) =    distanceBetweenPoints(x, y, other.x, other.y)

}

object Point {

  def distanceBetweenPoints(x1: Double, y1: Double,      x2: Double, y2: Double) = {    math.hypot(x1 - x2, y1 - y2)  }

}

The code above shows some of the conceptual differences between Java and Scala's handling of classes:

  • Scala has no static variables or methods. Instead, it has singleton objects, which are essentially classes with only one instance. Singleton objects are declared using object instead of class. It is common to place static variables and methods in a singleton object with the same name as the class name, which is then known as a companion object.[15] (The underlying class for the singleton object has a $ appended. Hence, for class Foo with companion object object Foo, under the hood there's a class Foo$ containing the companion object's code, and one object of this class is created, using the singleton pattern.)
  • In place of constructor parameters, Scala has class parameters, which are placed on the class, similar to parameters to a function. When declared with a val or var modifier, fields are also defined with the same name, and automatically initialized from the class parameters. (Under the hood, external access to public fields always goes through accessor (getter) and mutator (setter) methods, which are automatically created. The accessor function has the same name as the field, which is why it's unnecessary in the above example to explicitly declare accessor methods.) Note that alternative constructors can also be declared, as in Java. Code that would go into the default constructor (other than initializing the member variables) goes directly at class level.
  • Default visibility in Scala is public.

Features (with reference to Java)

Scala has the same compiling model as Java and C#, namely separate compiling and dynamic class loading, so that Scala code can call Java libraries.

Scala's operational characteristics are the same as Java's. The Scala compiler generates byte code that is nearly identical to that generated by the Java compiler.[15] In fact, Scala code can be decompiled to readable Java code, with the exception of certain constructor operations. To the Java virtual machine (JVM), Scala code and Java code are indistinguishable. The only difference is one extra runtime library, scala-library.jar.[29]

Scala adds a large number of features compared with Java, and has some fundamental differences in its underlying model of expressions and types, which make the language theoretically cleaner and eliminate several corner cases in Java. From the Scala perspective, this is practically important because several added features in Scala are also available in C#. Examples include:

Syntactic flexibility

As mentioned above, Scala has a good deal of syntactic flexibility, compared with Java. The following are some examples:

  • Semicolons are unnecessary; lines are automatically joined if they begin or end with a token that cannot normally come in this position, or if there are unclosed parentheses or brackets.
  • Any method can be used as an infix operator, e.g. "%d apples".format(num) and "%d apples" format num are equivalent. In fact, arithmetic operators like + and << are treated just like any other methods, since function names are allowed to consist of sequences of arbitrary symbols (with a few exceptions made for things like parens, brackets and braces that must be handled specially); the only special treatment that such symbol-named methods undergo concerns the handling of precedence.
  • Methods apply and update have syntactic short forms. foo()—where foo is a value (singleton object or class instance)—is short for foo.apply(), and foo() = 42 is short for foo.update(42). Similarly, foo(42) is short for foo.apply(42), and foo(4) = 2 is short for foo.update(4, 2). This is used for collection classes and extends to many other cases, such as STM cells.
  • Scala distinguishes between no-parens (def foo = 42) and empty-parens (def foo() = 42) methods. When calling an empty-parens method, the parentheses may be omitted, which is useful when calling into Java libraries that do not know this distinction, e.g., using foo.toString instead of foo.toString(). By convention, a method should be defined with empty-parens when it performs side effects.
  • Method names ending in colon (:) expect the argument on the left-hand-side and the receiver on the right-hand-side. For example, the 4 :: 2 :: Nil is the same as Nil.::(2).::(4), the first form corresponding visually to the result (a list with first element 4 and second element 2).
  • Class body variables can be transparently implemented as separate getter and setter methods. For trait FooLike { var bar: Int }, an implementation may be {{code|2=scala|1=object Foo extends FooLike { private var x = 0; def bar = x; def bar_=(value: Int) { x = value {{)}}{{)}} } } }}. The call site will still be able to use a concise foo.bar = 42.
  • The use of curly braces instead of parentheses is allowed in method calls. This allows pure library implementations of new control structures.[30] For example, breakable { ... if (...) break() ... } looks as if breakable was a language defined keyword, but really is just a method taking a thunk argument. Methods that take thunks or functions often place these in a second parameter list, allowing to mix parentheses and curly braces syntax: Vector.fill(4) { math.random } is the same as Vector.fill(4)(math.random). The curly braces variant allows the expression to span multiple lines.
  • For-expressions (explained further down) can accommodate any type that defines monadic methods such as map, flatMap and filter.

By themselves, these may seem like questionable choices, but collectively they serve the purpose of allowing domain-specific languages to be defined in Scala without needing to extend the compiler. For example, Erlang's special syntax for sending a message to an actor, i.e. actor ! message can be (and is) implemented in a Scala library without needing language extensions.

Unified type system

Java makes a sharp distinction between primitive types (e.g. int and boolean) and reference types (any class). Only reference types are part of the inheritance scheme, deriving from java.lang.Object. In Scala, all types inherit from a top-level class Any, whose immediate children are AnyVal (value types, such as Int and Boolean) and AnyRef (reference types, as in Java). This means that the Java distinction between primitive types and boxed types (e.g. int vs. Integer) is not present in Scala; boxing and unboxing is completely transparent to the user. Scala 2.10 allows for new value types to be defined by the user.

For-expressions

Instead of the Java "foreach" loops for looping through an iterator, Scala has for-expressions, which are similar to list comprehensions in languages such as Haskell, or a combination of list comprehensions and generator expressions in Python. For-expressions using the yield keyword allow a new collection to be generated by iterating over an existing one, returning a new collection of the same type. They are translated by the compiler into a series of map, flatMap and filter calls. Where yield is not used, the code approximates to an imperative-style loop, by translating to foreach.

A simple example is:

val s = for (x <- 1 to 25 if x*x > 50) yield 2*x

The result of running it is the following vector:

Vector(16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50)

(Note that the expression 1 to 25 is not special syntax. The method to is rather defined in the standard Scala library as an extension method on integers, using a technique known as implicit conversions[31] that allows new methods to be added to existing types.)

A more complex example of iterating over a map is:

// Given a map specifying Twitter users mentioned in a set of tweets,

// and number of times each user was mentioned, look up the users

// in a map of known politicians, and return a new map giving only the

// Democratic politicians (as objects, rather than strings).

val dem_mentions = for {

    (mention, times) <- mentions    account          <- accounts.get(mention)    if account.party == "Democratic"  } yield (account, times)

Expression (mention, times) <- mentions is an example of pattern matching (see below). Iterating over a map returns a set of key-value tuples, and pattern-matching allows the tuples to easily be destructured into separate variables for the key and value. Similarly, the result of the comprehension also returns key-value tuples, which are automatically built back up into a map because the source object (from the variable mentions) is a map. Note that if mentions instead held a list, set, array or other collection of tuples, exactly the same code above would yield a new collection of the same type.

Functional tendencies

While supporting all of the object-oriented features available in Java (and in fact, augmenting them in various ways), Scala also provides a large number of capabilities that are normally found only in functional programming languages. Together, these features allow Scala programs to be written in an almost completely functional style and also allow functional and object-oriented styles to be mixed.

Examples are:

  • No distinction between statements and expressions
  • Type inference
  • Anonymous functions with capturing semantics (i.e., closures)
  • Immutable variables and objects
  • Lazy evaluation
  • Delimited continuations (since 2.8)
  • Higher-order functions
  • Nested functions
  • Currying
  • Pattern matching
  • Algebraic data types (through case classes)
  • Tuples

Everything is an expression

{{unreferenced section|date=June 2013}}

Unlike C or Java, but similar to languages such as Lisp, Scala makes no distinction between statements and expressions. All statements are in fact expressions that evaluate to some value. Functions that would be declared as returning void in C or Java, and statements like while that logically do not return a value, are in Scala considered to return the type Unit, which is a singleton type, with only one object of that type. Functions and operators that never return at all (e.g. the throw operator or a function that always exits non-locally using an exception) logically have return type Nothing, a special type containing no objects; that is, a bottom type, i.e. a subclass of every possible type. (This in turn makes type Nothing compatible with every type, allowing type inference to function correctly.)

Similarly, an if-then-else "statement" is actually an expression, which produces a value, i.e. the result of evaluating one of the two branches. This means that such a block of code can be inserted wherever an expression is desired, obviating the need for a ternary operator in Scala:

// Java:

int hexDigit = x >= 10 ? x + 'A' - 10 : x + '0';

// Scala:

val hexDigit = if (x >= 10) x + 'A' - 10 else x + '0'

For similar reasons, return statements are unnecessary in Scala, and in fact are discouraged. As in Lisp, the last expression in a block of code is the value of that block of code, and if the block of code is the body of a function, it will be returned by the function.

To make it clear that all functions are expressions, even methods that return Unit are written with an equals sign

def printValue(x: String): Unit = {

}

or equivalently (with type inference, and omitting the unnecessary braces):

def printValue(x: String) = println("I ate a %s" format x)

Type inference

Due to type inference, the type of variables, function return values, and many other expressions can typically be omitted, as the compiler can deduce it. Examples are val x = "foo" (for an immutable constant or immutable object) or var x = 1.5 (for a variable whose value can later be changed). Type inference in Scala is essentially local, in contrast to the more global Hindley-Milner algorithm used in Haskell, ML and other more purely functional languages. This is done to facilitate object-oriented programming. The result is that certain types still need to be declared (most notably, function parameters, and the return types of recursive functions), e.g.

def formatApples(x: Int) = "I ate %d apples".format(x)

or (with a return type declared for a recursive function)

def factorial(x: Int): Int =

  if (x == 0)    1  else    x*factorial(x - 1)

Anonymous functions

In Scala, functions are objects, and a convenient syntax exists for specifying anonymous functions. An example is the expression x => x < 2, which specifies a function with one parameter, that compares its argument to see if it is less than 2. It is equivalent to the Lisp form (lambda (x) (< x 2)). Note that neither the type of x nor the return type need be explicitly specified, and can generally be inferred by type inference; but they can be explicitly specified, e.g. as (x: Int) => x < 2 or even (x: Int) => (x < 2): Boolean.

Anonymous functions behave as true closures in that they automatically capture any variables that are lexically available in the environment of the enclosing function. Those variables will be available even after the enclosing function returns, and unlike in the case of Java's anonymous inner classes do not need to be declared as final. (It is even possible to modify such variables if they are mutable, and the modified value will be available the next time the anonymous function is called.)

An even shorter form of anonymous function uses placeholder variables: For example, the following:

list map { x => sqrt(x) }

can be written more concisely as

list map { sqrt(_) }

or even

list map sqrt

Immutability

Scala enforces a distinction between immutable (unmodifiable, read-only) variables, whose value cannot be changed once assigned, and mutable variables, which can be changed. A similar distinction is made between immutable and mutable objects. The distinction must be made when a variable is declared: Immutable variables are declared with val while mutable variables use var. Similarly, all of the collection objects (container types) in Scala, e.g. linked lists, arrays, sets and hash tables, are available in mutable and immutable variants, with the immutable variant considered the more basic and default implementation. The immutable variants are "persistent" data types in that they create a new object that encloses the old object and adds the new member(s); this is similar to how linked lists are built up in Lisp, where elements are prepended by creating a new "cons" cell with a pointer to the new element (the "head") and the old list (the "tail"). This allows for very easy concurrency — no locks are needed as no shared objects are ever modified.

Immutable structures are also constructed efficiently, in the sense that modified instances reuses most of old instance data and unused/unreferenced parts are collected by GC.[32]

Lazy (non-strict) evaluation

Evaluation is strict ("eager") by default. In other words, Scala evaluates expressions as soon as they are available, rather than as needed. However, it is possible to declare a variable non-strict ("lazy") with the lazy keyword, meaning that the code to produce the variable's value will not be evaluated until the first time the variable is referenced. Non-strict collections of various types also exist (such as the type Stream, a non-strict linked list), and any collection can be made non-strict with the view method. Non-strict collections provide a good semantic fit to things like server-produced data, where the evaluation of the code to generate later elements of a list (that in turn triggers a request to a server, possibly located somewhere else on the web) only happens when the elements are actually needed.

Tail recursion

Functional programming languages commonly provide tail call optimization to allow for extensive use of recursion without stack overflow problems. Limitations in Java bytecode complicate tail call optimization on the JVM. In general, a function that calls itself with a tail call can be optimized, but mutually recursive functions cannot. Trampolines have been suggested as a workaround.[33] Trampoline support has been provided by the Scala library with the object scala.util.control.TailCalls since Scala 2.8.0 (released 14 July 2010). A function may optionally be annotated with @tailrec, in which case it will not compile unless it is tail recursive.[34]

Case classes and pattern matching

Scala has built-in support for pattern matching, which can be thought of as a more sophisticated, extensible version of a switch statement, where arbitrary data types can be matched (rather than just simple types like integers, booleans and strings), including arbitrary nesting. A special type of class known as a case class is provided, which includes automatic support for pattern matching and can be used to model the algebraic data types used in many functional programming languages. (From the perspective of Scala, a case class is simply a normal class for which the compiler automatically adds certain behaviors that could also be provided manually, e.g., definitions of methods providing for deep comparisons and hashing, and destructuring a case class on its constructor parameters during pattern matching.)

An example of a definition of the quicksort algorithm using pattern matching is this:

def qsort(list: List[Int]): List[Int] = list match {

  case Nil => Nil  case pivot :: tail =>    val (smaller, rest) = tail.partition(_ < pivot)    qsort(smaller) ::: pivot :: qsort(rest)

}

The idea here is that we partition a list into the elements less than a pivot and the elements not less, recursively sort each part, and paste the results together with the pivot in between. This uses the same divide-and-conquer strategy of mergesort and other fast sorting algorithms.

The match operator is used to do pattern matching on the object stored in list. Each case expression is tried in turn to see if it will match, and the first match determines the result. In this case, Nil only matches the literal object Nil, but pivot :: tail matches a non-empty list, and simultaneously destructures the list according to the pattern given. In this case, the associated code will have access to a local variable named pivot holding the head of the list, and another variable tail holding the tail of the list. Note that these variables are read-only, and are semantically very similar to variable bindings established using the let operator in Lisp and Scheme.

Pattern matching also happens in local variable declarations. In this case, the return value of the call to tail.partition is a tuple — in this case, two lists. (Tuples differ from other types of containers, e.g. lists, in that they are always of fixed size and the elements can be of differing types — although here they are both the same.) Pattern matching is the easiest way of fetching the two parts of the tuple.

The form _ < pivot is a declaration of an anonymous function with a placeholder variable; see the section above on anonymous functions.

The list operators :: (which adds an element onto the beginning of a list, similar to cons in Lisp and Scheme) and ::: (which appends two lists together, similar to append in Lisp and Scheme) both appear. Despite appearances, there is nothing "built-in" about either of these operators. As specified above, any string of symbols can serve as function name, and a method applied to an object can be written "infix"-style without the period or parentheses. The line above as written:

qsort(smaller) ::: pivot :: qsort(rest)

could also be written thus:

qsort(rest).::(pivot).:::(qsort(smaller))

in more standard method-call notation. (Methods that end with a colon are right-associative and bind to the object to the right.)

Partial functions

In the pattern-matching example above, the body of the match operator is a partial function, which consists of a series of case expressions, with the first matching expression prevailing, similar to the body of a switch statement. Partial functions are also used in the exception-handling portion of a try statement:

try {

} catch {

  case nfe:NumberFormatException => { println(nfe); List(0) }  case _ => Nil

}

Finally, a partial function can be used alone, and the result of calling it is equivalent to doing a match over it. For example, the prior code for quicksort can be written thus:

val qsort: List[Int] => List[Int] = {

  case Nil => Nil  case pivot :: tail =>    val (smaller, rest) = tail.partition(_ < pivot)    qsort(smaller) ::: pivot :: qsort(rest)

}

Here a read-only variable is declared whose type is a function from lists of integers to lists of integers, and bind it to a partial function. (Note that the single parameter of the partial function is never explicitly declared or named.) However, we can still call this variable exactly as if it were a normal function:

scala> qsort(List(6,2,5,9))

res32: List[Int] = List(2, 5, 6, 9)

Object-oriented extensions

Scala is a pure object-oriented language in the sense that every value is an object. Data types and behaviors of objects are described by classes and traits. Class abstractions are extended by subclassing and by a flexible mixin-based composition mechanism to avoid the problems of multiple inheritance.

Traits are Scala's replacement for Java's interfaces. Interfaces in Java versions under 8 are highly restricted, able only to contain abstract function declarations. This has led to criticism that providing convenience methods in interfaces is awkward (the same methods must be reimplemented in every implementation), and extending a published interface in a backwards-compatible way is impossible. Traits are similar to mixin classes in that they have nearly all the power of a regular abstract class, lacking only class parameters (Scala's equivalent to Java's constructor parameters), since traits are always mixed in with a class. The super operator behaves specially in traits, allowing traits to be chained using composition in addition to inheritance. The following example is a simple window system:

abstract class Window {

  // abstract  def draw()

}

class SimpleWindow extends Window {

  def draw() {    println("in SimpleWindow")    // draw a basic window  }

}

trait WindowDecoration extends Window { }

trait HorizontalScrollbarDecoration extends WindowDecoration {

  // "abstract override" is needed here in order for "super()" to work because the parent  // function is abstract. If it were concrete, regular "override" would be enough.  abstract override def draw() {    println("in HorizontalScrollbarDecoration")    super.draw()    // now draw a horizontal scrollbar  }

}

trait VerticalScrollbarDecoration extends WindowDecoration {

  abstract override def draw() {    println("in VerticalScrollbarDecoration")    super.draw()    // now draw a vertical scrollbar  }

}

trait TitleDecoration extends WindowDecoration {

  abstract override def draw() {    println("in TitleDecoration")    super.draw()    // now draw the title bar  }

}

A variable may be declared thus:

val mywin = new SimpleWindow with VerticalScrollbarDecoration with HorizontalScrollbarDecoration with TitleDecoration

The result of calling mywin.draw() is:

in TitleDecoration

in HorizontalScrollbarDecoration

in VerticalScrollbarDecoration

in SimpleWindow

In other words, the call to draw first executed the code in TitleDecoration (the last trait mixed in), then (through the super() calls) threaded back through the other mixed-in traits and eventually to the code in Window, even though none of the traits inherited from one another. This is similar to the decorator pattern, but is more concise and less error-prone, as it doesn't require explicitly encapsulating the parent window, explicitly forwarding functions whose implementation isn't changed, or relying on run-time initialization of entity relationships. In other languages, a similar effect could be achieved at compile-time with a long linear chain of implementation inheritance, but with the disadvantage compared to Scala that one linear inheritance chain would have to be declared for each possible combination of the mix-ins.

Expressive type system

Scala is equipped with an expressive static type system that mostly enforces the safe and coherent use of abstractions. The type system is, however, not sound.[47] In particular, the type system supports:

  • Classes and abstract types as object members
  • Structural types
  • Path-dependent types
  • Compound types
  • Explicitly typed self references
  • Generic classes
  • Polymorphic methods
  • Upper and lower type bounds
  • Variance
  • Annotation
  • Views

Scala is able to infer types by usage. This makes most static type declarations optional. Static types need not be explicitly declared unless a compiler error indicates the need. In practice, some static type declarations are included for the sake of code clarity.

Type enrichment

A common technique in Scala, known as "enrich my library"[35] (originally termed as "pimp my library" by Martin Odersky in 2006;[31] though concerns were raised about this phrasing due to its negative connotation[36] and immaturity[37]), allows new methods to be used as if they were added to existing types. This is similar to the C# concept of extension methods but more powerful, because the technique is not limited to adding methods and can, for instance, be used to implement new interfaces. In Scala, this technique involves declaring an implicit conversion from the type "receiving" the method to a new type (typically, a class) that wraps the original type and provides the additional method. If a method cannot be found for a given type, the compiler automatically searches for any applicable implicit conversions to types that provide the method in question.

This technique allows new methods to be added to an existing class using an add-on library such that only code that imports the add-on library gets the new functionality, and all other code is unaffected.

The following example shows the enrichment of type Int with methods isEven and isOdd:

object MyExtensions {

  implicit class IntPredicates(i: Int) {    def isEven = i % 2 == 0    def isOdd  = !isEven  }

}

import MyExtensions._ // bring implicit enrichment into scope

4.isEven // -> true

Importing the members of MyExtensions brings the implicit conversion to extension class IntPredicates into scope.[38]

Concurrency

Scala's standard library includes support for the actor model, in addition to the standard Java concurrency APIs. Lightbend Inc. provides a platform[39] that includes Akka,[40] a separate open-source framework that provides actor-based concurrency. Akka actors may be distributed or combined with software transactional memory (transactors). Alternative communicating sequential processes (CSP) implementations for channel-based message passing are Communicating Scala Objects,[41] or simply via JCSP.

An Actor is like a thread instance with a mailbox. It can be created by system.actorOf, overriding the receive method to receive messages and using the ! (exclamation point) method to send a message.[42]

The following example shows an EchoServer that can receive messages and then print them.

val echoServer = actor(new Act {

  become {    case msg => println("echo " + msg)  }

})

echoServer ! "hi"

Scala also comes with built-in support for data-parallel programming in the form of Parallel Collections[43] integrated into its Standard Library since version 2.9.0.

The following example shows how to use Parallel Collections to improve performance.[44]

val urls = List("https://scala-lang.org", "https://github.com/scala/scala")

def fromURL(url: String) = scala.io.Source.fromURL(url)

val t = System.currentTimeMillis()

urls.par.map(fromURL(_))

println("time: " + (System.currentTimeMillis - t) + "ms")

Besides actor support and data-parallelism, Scala also supports asynchronous programming with Futures and Promises, software transactional memory, and event streams.[45]

Cluster computing

The most well-known open-source cluster-computing solution written in Scala is Apache Spark. Additionally, Apache Kafka, the publish–subscribe message queue popular with Spark and other stream processing technologies, is written in Scala.

Testing

There are several ways to test code in Scala. ScalaTest supports multiple testing styles and can integrate with Java-based testing frameworks.[46] ScalaCheck is a library similar to Haskell's QuickCheck.[47] specs2 is a library for writing executable software specifications.[48] ScalaMock provides support for testing high-order and curried functions.[49] JUnit and TestNG are popular testing frameworks written in Java.

Versions

VersionReleasedFeaturesStatus
1.0.0-b2[50] 8-Dec-2003 _ _
1.1.0-b1[50] 19-Feb-2004
  • scala.Enumeration
  • Scala license was changed to the revised BSD license
_
1.1.1[50] 23-Mar-2004
  • Support for Java static inner classes
  • Library class improvements to Iterable, Array, xml.Elem, Buffer
_
1.2.0[50] 9-Jun-2004
  • Views
  • XML Literals
_
1.3.0[50] 16-Sep-2004
  • Support for Microsoft .NET
  • Method closures
  • Type syntax for parameterless methods changed from [] T to => T
_
1.4.0[50] 20-Jun-2005
  • Attributes
  • match keyword replaces match method
  • Experimental support for runtime types
_
2.0[51] 12-Mar-2006
  • Compiler completely rewritten in Scala
  • Experimental support for Java generics
  • implicit and requires keywords
  • match keyword only allowed infix
  • with connective is only allowed following an extends clause
  • Newlines can be used as statement separators in place of semicolons
  • Regular expression match patterns restricted to sequence patterns only
  • For-comprehensions admit value and pattern definitions
  • Class parameters may be prefixed by val or var
  • Private visibility has qualifiers
_
2.1.0[50] 17-Mar-2006
  • sbaz tool integrated in the Scala distribution
  • match keyword replaces match method
  • Experimental support for runtime types
_
2.1.8[52] 23-Aug-2006
  • Protected visibility has qualifiers
  • Private members of a class can be referenced from the companion module of the class and vice versa
  • Implicit lookup generalised
  • Typed pattern match tightened for singleton types
_
2.3.0[53] 23-Nov-2006
  • Functions returning Unit don't have to explicitly state a return type
  • Type variables and types are distinguished between in pattern matching
  • All and AllRef renamed to Nothing and Null
_
2.4.0[54] 09-Mar-2007
  • private and protected modifiers accept a [this] qualifier
  • Tuples can be written with round brackets
  • Primary constructor of a class can now be marked private or protected
  • Attributes changed to annotations with new syntax
  • Self aliases
  • Operators can be combined with assignment
_
2.5.0[55] 02-May-2007
  • Type parameters and abstract type members can also abstract over type constructors
  • Fields of an object can be initialized before parent constructors are called
  • Syntax change for-comprehensions
  • Implicit anonymous functions (with underscores for parameters)
  • Pattern matching of anonymous functions extended to support any arty
_
2.6.0[56] 27-Jul-2007
  • Existential types
  • Lazy values
  • Structural types
_
2.7.0[57] 07-Feb-2008
  • Java generic types supported by default
  • Case classes functionality extended
_
2.8.0[58] 14-Jul-2010
  • Revision the common, uniform, and all-encompassing framework for collection types.
  • Type specialisation
  • Named and default arguments
  • Package objects
  • Improved annotations
_
2.9.0[59] 12-May-2011
  • Parallel collections
  • Thread safe App trait replaces Application trait
  • DelayedInit trait
  • Java Interop improvements
_
2.10[60] 04-Jan-2013
  • Value Classes[61]
  • Implicit Classes[62]
  • String Interpolation[63]
  • Futures and Promises[64]
  • Dynamic and applyDynamic[65]
  • Dependent method types:
    • def identity(x: AnyRef): x.type = x // the return type says we return exactly what we got
  • New ByteCode emitter based on ASM:
    • Can target JDK 1.5, 1.6 and 1.7
    • Emits 1.6 bytecode by default
    • Old 1.5 backend is deprecated
  • A new Pattern Matcher: rewritten from scratch to generate more robust code (no more exponential blow-up!)
    • code generation and analyses are now independent (the latter can be turned off with -Xno-patmat-analysis)
  • Scaladoc Improvements
    • Implicits (-implicits flag)
    • Diagrams (-diagrams flag, requires graphviz)
    • Groups (-groups)
  • Modularized Language features[66]
  • Parallel Collections[67] are now configurable with custom thread pools
  • Akka Actors now part of the distribution
    • scala.actors have been deprecated and the akka implementation is now included in the distribution.
  • Performance Improvements
    • Faster inliner
    • Range#sum is now O(1)
  • Update of ForkJoin library
  • Fixes in immutable TreeSet/TreeMap
  • Improvements to PartialFunctions
  • Addition of ??? and NotImplementedError
  • Addition of IsTraversableOnce + IsTraversableLike type classes for extension methods
  • Deprecations and cleanup
  • Floating point and octal literal syntax deprecation
  • Removed scala.dbc

Experimental features

  • Scala Reflection[68]
  • Macros[69]
_
2.10.2[70] 06-Jun-2013 _ _
2.10.3[71] 01-Oct-2013 _ _
2.10.4[72] 18-Mar-2014 _ _
2.10.5[73] 05-Mar-2015 _ _
2.11.0[74] 21-Apr-2014
  • Collection performance improvements
  • Compiler performance improvements
_
2.11.1[75] 20-May-2014 _ _
2.11.2[76] 22-Jul-2014 _ _
2.11.4[77] 31-Oct-2014 _ _
2.11.5[78] 08-Jan-2015 _ _
2.11.6[79] 05-Mar-2015 _ _
2.11.7[80] 23-Jun-2015 _ _
2.11.8[81] 08-Mar-2016 _ _
2.11.11[82] 18-Apr-2017 _ _
2.11.12[83] 13-Nov-2017 _ _
2.12.0[84] 03-Nov-2016
  • Java 8 required
  • Java 8 bytecode generated
  • Java 8 SAM (Functional interface) language support
_
2.12.1[85] 05-Dec-2016 _ _
2.12.2[86] 18-Apr-2017 _ _
2.12.3[87] 26-Jul-2017 _ _
2.12.4[88] 17-Oct-2017 _ _
2.12.5[89] 15-Mar-2018 _ _
2.12.6[90] 27-Apr-2018 _ _
2.12.7[91] 27-Sep-2018 _ _
2.12.8[92] 04-Dec-2018 First Scala 2.12 release with the license changed to Apache v2.0 Current

Comparison with other JVM languages

Scala is often compared with Groovy and Clojure, two other programming languages also using the JVM. Substantial differences between these languages are found in the type system, in the extent to which each language supports object-oriented and functional programming, and in the similarity of their syntax to the syntax of Java.

Scala is statically typed, while both Groovy and Clojure are dynamically typed. This makes the type system more complex and difficult to understand but allows almost all[93] type errors to be caught at compile-time and can result in significantly faster execution. By contrast, dynamic typing requires more testing to ensure program correctness and is generally slower in order to allow greater programming flexibility and simplicity. Regarding speed differences, current versions of Groovy and Clojure allow for optional type annotations to help programs avoid the overhead of dynamic typing in cases where types are practically static. This overhead is further reduced when using recent versions of the JVM, which has been enhanced with an invoke dynamic instruction for methods that are defined with dynamically typed arguments. These advances reduce the speed gap between static and dynamic typing, although a statically typed language, like Scala, is still the preferred choice when execution efficiency is very important.

Regarding programming paradigms, Scala inherits the object-oriented model of Java and extends it in various ways. Groovy, while also strongly object-oriented, is more focused in reducing verbosity. In Clojure, object-oriented programming is deemphasised with functional programming being the main strength of the language. Scala also has many functional programming facilities, including features found in advanced functional languages like Haskell, and tries to be agnostic between the two paradigms, letting the developer choose between the two paradigms or, more frequently, some combination thereof.

Regarding syntax similarity with Java, Scala inherits much of Java's syntax, as is the case with Groovy. Clojure on the other hand follows the Lisp syntax, which is different in both appearance and philosophy. However, learning Scala is also considered difficult because of its many advanced features. This is not the case with Groovy, despite its also being a feature-rich language, mainly because it was designed to be mainly a scripting language.{{Citation needed|date=October 2015}}

Adoption

Language rankings

{{As of|2013}}, all JVM-based languages (Clojure, Groovy, Kotlin, Scala) are significantly less popular than the original Java language, which is usually ranked first or second,[114][94] and which is also simultaneously evolving over time.

The Popularity of Programming Language Index,[95] which tracks searches for language tutorials, ranked Scala 15th in April 2018 with a small downward trend. This makes Scala the most popular JVM-based language after Java, although immediately followed by Kotlin, a JVM-based language with a strong upward trend ranked 16th.

The TIOBE index[94] of programming language popularity employs internet search engine rankings and similar publication-counting to determine language popularity. As of April 2018, it shows Scala in 34th place, having dropped four places over the last two years, but–as mentioned under "Bugs & Change Requests"–TIOBE is aware of issues with its methodology of using search terms which might not be commonly used in some programming language communities. In this ranking Scala is ahead of some functional languages like Haskell (42nd), Erlang, but below other languages like Swift (15th), Perl (16th), Go (19th) and Clojure (30th).

The ThoughtWorks Technology Radar, which is an opinion based biannual report of a group of senior technologists,[96] recommended Scala adoption in its languages and frameworks category in 2013.[97] In July 2014, this assessment was made more specific and now refers to a "Scala, the good parts", which is described as "To successfully use Scala, you need to research the language and have a very strong opinion on which parts are right for you, creating your own definition of Scala, the good parts.".[98]

The RedMonk Programming Language Rankings, which establishes rankings based on the number of GitHub projects and questions asked on Stack Overflow, ranks Scala 14th.[114] Here, Scala is placed inside a second-tier group of languages–ahead of Go, PowerShell and Haskell, and behind Swift, Objective-C, Typescript and R. However, in its 2018 report, the Rankings noted a drop of Scala's rank for the third time in a row, questioning "how much of the available oxygen for Scala is consumed by Kotlin as the latter continues to rocket up these rankings".[99]

In the 2018 edition of the "State of Java" survey,[100] which collected data from 5160 developers on various Java-related topics, Scala places third in terms of usage of alternative languages on the JVM. Compared to the last year's edition of the survey, Scala's usage among alternative JVM languages fell by almost a quarter (from 28.4% to 21.5%), overtaken by Kotlin, which rose from 11.4% in 2017 to 28.8% in 2018.

{{clear}}

Companies

  • In April 2009, Twitter announced that it had switched large portions of its backend from Ruby to Scala and intended to convert the rest.[101]
  • Gilt uses Scala and Play Framework.[102]
  • Foursquare uses Scala and Lift.[103]
  • Coursera uses Scala and Play Framework.[104]
  • Apple Inc. uses Scala in certain teams, along with Java and the Play framework.[105][106]
  • The Guardian newspaper's high-traffic website guardian.co.uk[107] announced in April 2011 that it was switching from Java to Scala,[108][109]
  • The New York Times revealed in 2014 that its internal content management system Blackbeard is built using Scala, Akka and Play.[110]
  • The Huffington Post newspaper started to employ Scala as part of its contents delivery system Athena in 2013.[111]
  • Swiss bank UBS approved Scala for general production usage.[112]
  • LinkedIn uses the Scalatra microframework to power its Signal API.[113]
  • Meetup uses Unfiltered toolkit for real-time APIs.[114]
  • Remember the Milk uses Unfiltered toolkit, Scala and Akka for public API and real-time updates.[115]
  • Verizon seeking to make "a next-generation framework" using Scala.[116]
  • Airbnb develops open-source machine-learning software "Aerosolve", written in Java and Scala.[117]
  • Zalando moved its technology stack from Java to Scala and Play.[118]
  • SoundCloud uses Scala for its back-end, employing technologies such as Finagle (micro services),[119] Scalding and Spark (data processing).[120]
  • Databricks uses Scala for the Apache Spark Big Data platform.
  • Morgan Stanley uses Scala extensively in their finance and asset-related projects.[121]
  • There are teams within Google/Alphabet Inc. that use Scala, mostly due to acquisitions such as Firebase[122] and Nest.[123]
  • Walmart Canada Uses Scala for their back-end platform.[124]
  • Duolingo uses Scala for their back-end module that generates lessons.[125]
  • HMRC uses Scala for many government Tax applications.[126]

Criticism

In March 2015, former VP of the Platform Engineering group at Twitter Raffi Krikorian, stated that he would not have chosen Scala in 2011 due to its learning curve.[127] The same month, LinkedIn SVP Kevin Scott stated their decision to "minimize [their] dependence on Scala".[128] In November 2011, Yammer moved away from Scala for reasons that included the learning curve for new team members and incompatibility from one version of the Scala compiler to the next.[129]

See also

{{Portal|Free and open-source software|Java (programming language)}}
  • sbt, a widely used build tool for Scala projects
  • Play!, an open-source Web application framework that supports Scala
  • Akka, an open-source toolkit for building concurrent and distributed applications
{{Category see also|Free software programmed in Scala}}

References

1. ^{{cite web |url=https://www.scala-js.org/ |title=Scala.js |accessdate=2015-07-27}}
2. ^{{cite web |url=http://www.scala-native.org/ |title=Scala Native |accessdate=2015-07-27}}
3. ^{{cite web |url=https://www.scala-lang.org/news/2.12.8 |title= Scala 2.12.8 is now available! |date=2018-12-04 |accessdate=2018-12-09}}
4. ^{{cite web |url=https://www.scala-lang.org/news/2.12.8 |title= Scala 2.12.8 is now available! |date=2018-12-04 |accessdate=2018-12-09}}
5. ^{{cite web |title=Scala Macros |url=http://scalamacros.org}}
6. ^{{cite web |url=http://blog.fogus.me/2010/08/06/martinodersky-take5-tolist/ |title=MartinOdersky take(5) toList|last=Fogus|first=Michael |date=6 August 2010|work=Send More Paramedics |accessdate=2012-02-09}}
7. ^{{cite web |url=http://lampwww.epfl.ch/~odersky/talks/popl06.pdf |title=The Scala Experiment - Can We Provide Better Language Support for Component Systems? |last=Odersky|first=Martin |date=11 January 2006 |accessdate=2016-06-22}}
8. ^Martin Odersky et al., An Overview of the Scala Programming Language, 2nd Edition
9. ^{{cite book |last=Odersky |first=Martin |date=2008 |title=Programming in Scala |url=https://books.google.com/?id=MFjNhTjeQKkC&lpg=PA1&dq=scala%20is%20pronounced%20skah-lah&pg=PA3#v=onepage&q=scala%20is%20pronounced%20skah-lah&f=false |location=Mountain View, California |publisher=Artima |page=3 |isbn=9780981531601 |accessdate=12 June 2014}}
10. ^{{Cite book |arxiv=1509.07326|title=An IMS DSL Developed at Ericsson |volume=7916 |last1=Potvin |first1=Pascal |last2=Bonja |first2=Mario |date=24 September 2015 |doi= 10.1007/978-3-642-38911-5|series=Lecture Notes in Computer Science |isbn=978-3-642-38910-8 }}
11. ^{{cite web |url=https://www.scala-lang.org/old/faq/4 |title=Frequently Asked Questions - Java Interoperability |author= |website=scala-lang.org |accessdate=2015-02-06}}
12. ^{{cite web |url=https://www.javaworld.com/article/3142626/core-java/are-checked-exceptions-good-or-bad.html |title=Are checked exceptions good or bad? |date=16 November 2016 |last=Friesen |first=Jeff |website=JavaWorld |accessdate=28 August 2018}}
13. ^{{cite book |last=Loverdo |first=Christos |date=2010 |title=Steps in Scala: An Introduction to Object-Functional Programming |url=https://books.google.com/?id=vZAfN_Vk2i0C&pg=PR13&dq=%22steps+in+scala%22#v=onepage&q=%22steps%20in%20scala%22&f=false |publisher=Cambridge University Press |page=xiii |isbn=9781139490948 |accessdate=31 July 2014}}
14. ^Martin Odersky, [https://www.artima.com/weblogs/viewpost.jsp?thread=163733 "A Brief History of Scala"], Artima.com weblogs, 9 June 2006
15. ^{{Cite journal |doi= 10.1145/2591013 |title= Unifying functional and object-oriented programming with Scala |journal= Communications of the ACM |volume= 57 |issue= 4 |page= 76 |year= 2014 |last1= Odersky |first1= M. |last2= Rompf |first2= T.}}
16. ^Martin Odersky, "The Scala Language Specification Version 2.7"
17. ^{{cite web|url=https://www.scala-lang.org/node/8579|title=Scala Team Wins ERC Grant|accessdate=4 July 2015}}
18. ^{{cite web |url=https://www.scala-lang.org/node/9484 |title=Commercial Support for Scala |date=2011-05-12 |accessdate=2011-08-18}}
19. ^{{cite web |url=https://medium.com/@greylockvc/why-we-invested-in-typesafe-modern-applications-demand-modern-tools-b6f7deec8b89 |title=Why We Invested in Typesafe: Modern Applications Demand Modern Tools |date=2011-05-12 |accessdate=2018-05-08 }}
20. ^{{cite web |url=http://news.cnet.com/8301-13846_3-20062090-62.html |title=Open-source Scala gains commercial backing |date=2011-05-12 |accessdate=2011-10-09}}
21. ^{{cite web |url=https://www.mercurynews.com/business/ci_18048434 |title=Cloud computing pioneer Martin Odersky takes wraps off his new company Typesafe |date=2011-05-12 |accessdate=2011-08-24}}
22. ^{{cite web|url=http://scala-android.org/|title=Scala on Android|accessdate=8 June 2016}}
23. ^{{cite web |url=https://www.scala-lang.org/news/2.12.8 |title= Scala 2.12.8 is now available! |date=2018-12-04 |accessdate=2018-12-09}}
24. ^{{cite web|url=https://www.scala-lang.org/blog/2015/02/05/scala-js-no-longer-experimental.html |title=Scala Js Is No Longer Experimental | The Scala Programming Language|publisher=Scala-lang.org |accessdate= 28 October 2015}}
25. ^{{cite web | url=https://www.infoworld.com/article/3180823/application-development/scaled-down-scala-variant-cuts-ties-to-the-jvm.html | title=Scaled-down Scala variant cuts ties to the JVM | date=15 March 2017 | accessdate=21 March 2017 | first=Paul | last=Krill | publisher=InfoWorld}}
26. ^{{ cite web | url=https://www.infoworld.com/article/3068669/application-development/scala-language-moves-closer-to-bare-metal.html | title=Scala language moves closer to bare metal | first=Paul | last=Krill | publisher=InfoWorld| date=2016-05-11 }}
27. ^[https://github.com/scala/scala/pull/1718 Expunged the .net backend. by paulp · Pull Request #1718 · scala/scala · GitHub]. Github.com (2012-12-05). Retrieved on 2013-11-02.
28. ^{{cite web |url=https://www.scala-lang.org/old/node/166 |title=Getting Started with Scala |author= |date=15 July 2008 |website=scala-lang.org |accessdate=31 July 2014}}
29. ^{{cite web |url=http://blog.lostlake.org/index.php?/archives/73-For-all-you-know,-its-just-another-Java-library.html |title=Home |publisher=Blog.lostlake.org |accessdate=2013-06-25 |deadurl=yes |archiveurl=https://web.archive.org/web/20100831041226/http://blog.lostlake.org/index.php?%2Farchives%2F73-For-all-you-know%2C-its-just-another-Java-library.html |archivedate=31 August 2010 |df= }}
30. ^Scala's built-in control structures such as if or while cannot be re-implemented. There is a research project, Scala-Virtualized, that aimed at removing these restrictions: Adriaan Moors, Tiark Rompf, Philipp Haller and Martin Odersky. [https://dl.acm.org/citation.cfm?id=2103769 Scala-Virtualized]. Proceedings of the ACM SIGPLAN 2012 workshop on Partial evaluation and program manipulation, 117–120. July 2012.
31. ^{{cite web|url=https://www.artima.com/weblogs/viewpost.jsp?thread=179766 |title=Pimp my Library |publisher=Artima.com |date=2006-10-09 |accessdate=2013-06-25}}
32. ^{{cite web|url=https://docs.scala-lang.org/overviews/collections/concrete-immutable-collection-classes.html|title=Collections - Concrete Immutable Collection Classes - Scala Documentation|accessdate=4 July 2015}}
33. ^{{cite web|url=http://blog.richdougherty.com/2009/04/tail-calls-tailrec-and-trampolines.html|title=Rich Dougherty's blog|first=Rich|last=Dougherty|accessdate=4 July 2015}}
34. ^{{cite web|url=https://www.scala-lang.org/api/current/scala/util/control/TailCalls$.html |title=TailCalls - Scala Standard Library API (Scaladoc) 2.10.2 - scala.util.control.TailCalls |publisher=Scala-lang.org |accessdate=2013-06-25}}
35. ^{{cite conference |arxiv=1210.6284|title=Reify your collection queries for modularity and speed! |last1=Giarrusso |first1=Paolo G. |date=2013 |publisher=ACM |book-title=Proceedings of the 12th annual international conference on Aspect-oriented software development |quote=Also known as pimp-my-library pattern|bibcode=2012arXiv1210.6284G }}
36. ^{{cite newsgroup |title=What is highest priority for Scala to succeed |author=marc |date=11 November 2011 |newsgroup=scala-user@googlegroups.com |message-id=5383616.373.1321307029214.JavaMail.geo-discussion-forums@prmf13 |url=https://groups.google.com/forum/#!original/scala-user/tIWGHcvQqH8/jUmV9cMdRJIJ |access-date=15 April 2016}}
37. ^{{cite web |url=https://meta.stackexchange.com/questions/184514/should-we-enrich-or-pimp-scala-libraries |title=Should we "enrich" or "pimp" Scala libraries? |author= |date=17 June 2013 |website=stackexchange.com |access-date=15 April 2016}}
38. ^Implicit classes were introduced in Scala 2.10 to make method extensions more concise. This is equivalent to adding a method implicit def IntPredicate(i: Int) = new IntPredicate(i). The class can also be defined as implicit class IntPredicates(val i: Int) extends AnyVal { ... }, producing a so-called value class, also introduced in Scala 2.10. The compiler will then eliminate actual instantiations and generate static methods instead, allowing extension methods to have virtually no performance overhead.
39. ^{{cite web |url=https://www.lightbend.com/platform |title=Lightbend Reactive Platform |author= |publisher=Lightbend |accessdate=2016-07-15}}
40. ^[https://doc.akka.io/docs/akka/snapshot/intro/what-is-akka.html What is Akka?], Akka online documentation
41. ^Communicating Scala Objects, Bernard Sufrin, Communicating Process Architectures 2008
42. ^{{cite web|url=http://www.scala-tour.com/#/using-actor|title=Scala Tour|first=Kay|last=Yan|accessdate=4 July 2015}}
43. ^{{cite web|url=https://docs.scala-lang.org/overviews/parallel-collections/overview.html |title=Parallelcollections - Overview - Scala Documentation |publisher=Docs.scala-lang.org |accessdate=2013-06-25}}
44. ^{{cite web|url=http://www.scala-tour.com/#/parallel-collection|title=Scala Tour|first=Kay|last=Yan|accessdate=4 July 2015}}
45. ^[https://www.amazon.com/Learning-Concurrent-Programming-Aleksandar-Prokopec/dp/1783281413/ Learning Concurrent Programming in Scala], Aleksandar Prokopec, Packt Publishing
46. ^{{cite web |url=http://www.hascode.com/2013/01/a-short-introduction-to-scalatest/ |title=A short Introduction to ScalaTest |last1=Kops |first1=Micha |date=2013-01-13 |website=hascode.com |accessdate=2014-11-07}}
47. ^{{cite web |url=https://www.scala-lang.org/old/node/352.html |title=ScalaCheck 1.5 |last1=Nilsson |first1=Rickard |date=2008-11-17 |website=scala-lang.org |accessdate=2014-11-07}}
48. ^{{cite web |url=http://workwithplay.com/blog/2013/05/22/testing-with-spec2/ |title=Build web applications using Scala and the Play Framework |date=2013-05-22 |website=workwithplay.com |accessdate=2014-11-07}}
49. ^{{cite web |url=https://paulbutcher.com/2012/06/04/scalamock-3-0-preview-release/ |title=ScalaMock 3.0 Preview Release |last1=Butcher |first1=Paul |date=2012-06-04 |website=paulbutcher.com |accessdate=2014-11-07}}
50. ^{{cite web |url=http://www.scala-lang.org/downloads/history.html |title=Scala Change History |author= |website=scala-lang.org |archive-url=https://web.archive.org/web/20071009004609/http://www.scala-lang.org/downloads/history.html |archive-date=2007-10-09 |dead-url=yes |df= }}
51. ^{{cite web |url=https://www.scala-lang.org/download/changelog.html#changes-in-version-20-12-mar-2006--20- |title=Changes in Version 2.0 (12-Mar-2006) |author= |date=2006-03-12 |website=scala-lang.org |accessdate=2014-11-07}}
52. ^{{cite web |url=https://www.scala-lang.org/download/changelog.html#2.1.8 |title=Changes in Version 2.1.8 (23-Aug-2006) |author= |date=2006-08-23 |website=scala-lang.org |accessdate=2014-11-07}}
53. ^{{cite web |url=https://www.scala-lang.org/download/changelog.html#2.3.0 |title=Changes in Version 2.3.0 (23-Nov-2006) |author= |date=2006-11-23 |website=scala-lang.org |accessdate=2014-11-07}}
54. ^{{cite web |url=https://www.scala-lang.org/download/changelog.html#2.4.0 |title=Changes in Version 2.4.0 (09-Mar-2007) |author= |date=2007-03-09 |website=scala-lang.org |accessdate=2014-11-07}}
55. ^{{cite web |url=https://www.scala-lang.org/download/changelog.html#2.5.0 |title=Changes in Version 2.5 (02-May-2007) |author= |date=2007-05-02 |website=scala-lang.org |accessdate=2014-11-07}}
56. ^{{cite web |url=https://www.scala-lang.org/download/changelog.html#2.6.0 |title=Changes in Version 2.6 (27-Jul-2007) |author= |date=2007-06-27 |website=scala-lang.org |accessdate=2014-11-07}}
57. ^{{cite web |url=https://www.scala-lang.org/download/changelog.html#2.7.0 |title=Changes in Version 2.7.0 (07-Feb-2008) |author= |date=2008-02-07 |website=scala-lang.org |accessdate=2014-11-07}}
58. ^{{cite web |url=https://www.scala-lang.org/download/changelog.html#2.8.0 |title=Changes in Version 2.8.0 (14-Jul-2010) |author= |date=2010-07-10 |website=scala-lang.org |accessdate=2014-11-07}}
59. ^{{cite web |url=https://www.scala-lang.org/download/changelog.html#2.9.0 |title=Changes in Version 2.9.0 (12-May-2011) |author= |date=2011-05-12 |website=scala-lang.org |accessdate=2014-11-07}}
60. ^{{cite web |url=https://www.scala-lang.org/download/changelog.html#changes_in_version_2100 |title=Changes in Version 2.10.0 |author= |date=2013-01-04 |website=scala-lang.org |accessdate=2014-11-07}}
61. ^{{cite web |url=https://docs.scala-lang.org/overviews/core/value-classes.html |title=Value Classes and Universal Traits |last1=Harrah |first1=Mark |website=scala-lang.org |accessdate=2014-11-07}}
62. ^{{cite web |url=https://docs.scala-lang.org/sips/completed/implicit-classes.html |title=SIP-13 - Implicit classes |last1=Suereth |first1=Josh |website=scala-lang.org |accessdate=2014-11-07}}
63. ^{{cite web |url=https://docs.scala-lang.org/overviews/core/string-interpolation.html |title=String Interpolation |last1=Suereth |first1=Josh |website=scala-lang.org |accessdate=2014-11-07}}
64. ^{{cite web |url=https://docs.scala-lang.org/overviews/core/futures.html |title=Futures and Promises |last1=Haller |first1=Philipp |last2=Prokopec |first2=Aleksandar |website=scala-lang.org |accessdate=2014-11-07}}
65. ^{{cite web |url=https://docs.scala-lang.org/sips/completed/type-dynamic.html |title=SIP-17 - Type Dynamic |author= |website=scala-lang.org |accessdate=2014-11-07}}
66. ^{{cite web |url=https://docs.scala-lang.org/sips/completed/modularizing-language-features.html |title=SIP-18 - Modularizing Language Features |author= |website=scala-lang.org |accessdate=2014-11-07}}
67. ^{{cite web |url=https://docs.scala-lang.org/overviews/parallel-collections/overview.html |title=Parallel Collections |last1=Prokopec |first1=Aleksandar |last2=Miller |first2=Heather |website=scala-lang.org |accessdate=2014-11-07}}
68. ^{{cite web |url=https://docs.scala-lang.org/overviews/reflection/overview.html |title=Reflection Overview |last1=Miller |first1=Heather |last2=Burmako |first2=Eugene |website=scala-lang.org |accessdate=2014-11-07}}
69. ^{{cite web |url=https://docs.scala-lang.org/overviews/macros/overview.html |title=Def Macros |last1=Burmako |first1=Eugene |website=scala-lang.org |accessdate=2014-11-07}}
70. ^{{cite web |url=https://www.scala-lang.org/news/2013/06/06/release-notes-v2.10.2.html |title=Scala 2.10.2 is now available! |author= |date=2013-06-06 |website=scala-lang.org |accessdate=2014-11-07 |archive-url=https://web.archive.org/web/20141108081141/http://www.scala-lang.org/news/2013/06/06/release-notes-v2.10.2.html |archive-date=2014-11-08 |dead-url=yes |df= }}
71. ^{{cite web |url=https://www.scala-lang.org/news/2013/10/01/release-notes-v2.10.3.html |title=Scala 2.10.3 is now available! |author= |date=2013-10-01 |website=scala-lang.org |accessdate=2014-11-07 |archive-url=https://web.archive.org/web/20141108081200/http://www.scala-lang.org/news/2013/10/01/release-notes-v2.10.3.html |archive-date=2014-11-08 |dead-url=yes |df= }}
72. ^{{cite web |url=https://www.scala-lang.org/news/2.10.4 |title=Scala 2.10.4 is now available! |author= |date=2014-03-18 |website=scala-lang.org |accessdate=2015-01-07}}
73. ^{{cite web |url=https://www.scala-lang.org/news/2.10.5 |title=Scala 2.10.5 is now available! |author= |date=2015-03-04 |website=scala-lang.org |accessdate=2015-03-23}}
74. ^{{cite web |url=https://www.scala-lang.org/news/2.11.0 |title=Scala 2.11.0 is now available! |author= |date=2014-04-21 |website=scala-lang.org |accessdate=2014-11-07}}
75. ^{{cite web |url=https://www.scala-lang.org/news/2.11.1 |title=Scala 2.11.1 is now available! |author= |date=2014-05-20 |website=scala-lang.org |accessdate=2014-11-07}}
76. ^{{cite web |url=https://www.scala-lang.org/news/2.11.2 |title=Scala 2.11.2 is now available! |author= |date=2014-07-22 |website=scala-lang.org |accessdate=2014-11-07}}
77. ^{{cite web |url=https://www.scala-lang.org/news/2.11.4 |title=Scala 2.11.4 is now available! |author= |date=2014-10-30 |website=scala-lang.org |accessdate=2014-11-07}}
78. ^{{cite web |url=https://www.scala-lang.org/news/2.11.5 |title=Scala 2.11.5 is now available! |author= |date=2015-01-08 |website=scala-lang.org |accessdate=2015-01-22}}
79. ^{{cite web |url=https://www.scala-lang.org/news/2.11.6 |title=Scala 2.11.6 is now available! |author= |date=2015-03-05 |website=scala-lang.org |accessdate=2015-03-12}}
80. ^{{cite web |url=https://www.scala-lang.org/news/2.11.7 |title=Scala 2.11.7 is now available! |author= |date=2015-06-23 |website=scala-lang.org |accessdate=2015-07-03}}
81. ^{{cite web |url=https://www.scala-lang.org/news/2.11.8 |title=Scala 2.11.8 is now available! |author= |date=2016-03-08 |website=scala-lang.org |accessdate=2016-03-09}}
82. ^{{cite web |url=https://www.scala-lang.org/news/releases-1Q17.html |title=Three new releases and more GitHub goodness! |author= |date=2017-04-18 |website=scala-lang.org |accessdate=2017-04-19}}
83. ^{{cite web |url=https://www.scala-lang.org/news/security-update-nov17.html |title=Security update: 2.12.4, 2.11.12, 2.10.7 (CVE-2017-15288) |author= |date=2017-11-13 |website=scala-lang.org |accessdate=2018-05-04}}
84. ^{{cite web |url=https://www.scala-lang.org/news/2.12.0 |title=Scala 2.12.0 is now available! |author= |date=2016-11-03 |website=scala-lang.org |accessdate=2017-01-08}}
85. ^{{cite web |url=https://www.scala-lang.org/news/2.12.1 |title=Scala 2.12.1 is now available! |author= |date=2016-12-05 |website=scala-lang.org |accessdate=2017-01-08}}
86. ^{{cite web |url=https://www.scala-lang.org/news/releases-1Q17.html |title=Three new releases and more GitHub goodness! |author= |date=2017-04-18 |website=scala-lang.org |accessdate=2017-04-19}}
87. ^{{cite web |url=https://www.scala-lang.org/news/2.12.3 |title=SCALA 2.12.3 IS NOW AVAILABLE! |author= |date=2017-07-26 |website=scala-lang.org |accessdate=2017-08-16}}
88. ^{{cite web |url=https://www.scala-lang.org/news/2.12.4 |title=SCALA 2.12.4 IS NOW AVAILABLE! |author= |date=2017-10-18 |website=scala-lang.org |accessdate=2017-10-26}}
89. ^{{cite web |url=https://www.scala-lang.org/news/2.12.5 |title=SCALA 2.12.5 IS NOW AVAILABLE! |author= |date=2018-03-15 |website=scala-lang.org |accessdate=2018-03-20}}
90. ^{{cite web |url=https://www.scala-lang.org/news/2.12.6 |title=Scala 2.12.6 is now available! |date=2018-04-27 |accessdate=2018-05-04 |website=scala-lang.org}}
91. ^{{cite web |url=https://www.scala-lang.org/news/2.12.7 |title=Scala 2.12.7 is now available! |date=2018-09-27 |accessdate=2018-10-09 |website=scala-lang.org}}
92. ^{{cite web |url=https://www.scala-lang.org/news/2.12.8 |title=Scala 2.12.8 is now available! |date=2018-12-04 |accessdate=2018-12-09 |website=scala-lang.org}}
93. ^{{cite web|url=https://raw.githubusercontent.com/namin/unsound/master/doc/unsound-oopsla16.pdf|title=Java and Scala's Type Systems are Unsound}}
94. ^{{cite news|title=TIOBE Index for April 2018 |url=https://www.tiobe.com/index.php/content/paperinfo/tpci/index.html}}
95. ^{{cite news|title=Popularity of Programming Language Index|url=https://pypl.github.io/PYPL.html}}
96. ^{{cite news|title=ThoughtWorks Technology Radar FAQ|url=https://martinfowler.com/articles/radar-faq.html}}
97. ^{{cite news|title=ThoughtWorks Technology Radar MAY 2013 |url=http://thoughtworks.fileburst.com/assets/technology-radar-may-2013.pdf}}
98. ^{{cite news|title=The RedMonk Programming Language Rankings: January 2018|url=https://www.thoughtworks.com/radar/languages-and-frameworks/scala-the-good-parts}}
99. ^{{cite news|title=The RedMonk Programming Language Rankings: January 2018|url=http://redmonk.com/sogrady/2018/03/07/language-rankings-1-18/}}
100. ^{{cite news|title=The State of Java in 2018|url=http://www.baeldung.com/java-in-2018}}
101. ^{{cite web |last= Greene |first= Kate |title= The Secret Behind Twitter's Growth, How a new Web programming language is helping the company handle its increasing popularity. |work= Technology Review |publisher= MIT |date= 1 April 2009 |url= https://www.technologyreview.com/blog/editors/23282/?nlid=1908 |accessdate= 6 April 2009}}
102. ^{{cite web|url=https://www.lightbend.com/blog/play_framework_akka_and_scala_at_gilt|title=Play Framework, Akka and Scala at Gilt Groupe |author=|date=15 July 2013|publisher=Lightbend|accessdate=16 July 2016}}
103. ^{{cite web|url=http://www.grenadesandwich.com/blog/steven/2009/11/27/scala-lift-and-future|title=Scala, Lift, and the Future|accessdate=4 July 2015|deadurl=yes|archiveurl=https://web.archive.org/web/20160113201402/http://www.grenadesandwich.com/blog/steven/2009/11/27/scala-lift-and-future|archivedate=13 January 2016|df=}}
104. ^{{cite web|url=https://tech.coursera.org/blog/2014/02/18/why-we-love-scala-at-coursera/|title=Why we love Scala at Coursera|publisher=Coursera Engineering|accessdate=4 July 2015}}
105. ^{{cite web|url=https://twitter.com/hayvok/status/705468085461889025|title=Apple Engineering PM Jarrod Nettles on Twitter|publisher=Jarrod Nettles|accessdate=2016-03-11}}
106. ^{{cite web|url=https://alvinalexander.com/photos/30-scala-job-openings-apple|title=30 Scala job openings at Apple|publisher=Alvin Alexander|accessdate=2016-03-11}}
107. ^{{Cite news|author1=David Reid |author2=Tania Teixeira |lastauthoramp=yes |url=http://news.bbc.co.uk/1/hi/programmes/click_online/8537519.stm |title=Are people ready to pay for online news?|publisher=BBC |accessdate=2010-02-28 |date=26 February 2010}}
108. ^{{cite web |url=http://www.h-online.com/open/news/item/Guardian-switching-from-Java-to-Scala-1221832.html |title=Guardian switching from Java to Scala |date=2011-04-05 |accessdate=2011-04-05|publisher=Heise Online}}
109. ^{{cite web |url=https://www.infoq.com/articles/guardian_scala |title=Guardian.co.uk Switching from Java to Scala|publisher=InfoQ.com |date=2011-04-04 |accessdate=2011-04-05}}
110. ^{{cite web |url=https://open.blogs.nytimes.com/2014/05/13/building-blackbeard-a-syndication-system-powered-by-play-scala-and-akka |author1=Roy, Suman |author2=Sundaresan, Krishna |lastauthoramp=yes |title=Building Blackbeard: A Syndication System Powered By Play, Scala and Akka |date=2014-05-13 |accessdate=2014-07-20}}
111. ^{{cite web |url=https://www.huffingtonpost.com/john-pavley/huffpost-content-management-system_b_3739572.html |author=Pavley, John |title=Sneak Peek: HuffPost Brings Real Time Collaboration to the Newsroom |date=2013-08-11 |accessdate=2014-07-20}}
112. ^{{cite web |url=http://drdobbs.com/architecture-and-design/231001802|author=Binstock, Andrew |title=Interview with Scala's Martin Odersky |date=2011-07-14 |accessdate=2012-02-10|publisher=Dr. Dobb's Journal}}
113. ^{{cite web |url=https://www.infoq.com/articles/linkedin-scala-jruby-voldemort|author=Synodinos, Dionysios G. |title=LinkedIn Signal: A Case Study for Scala, JRuby and Voldemort |date=2010-10-11|publisher=InfoQ}}
114. ^{{cite web |url=http://making.meetup.com/post/2929945070/real-life-meetups-deserve-real-time-apis |title=Real-life Meetups Deserve Real-time APIs}}
115. ^{{cite web |url=http://blog.rememberthemilk.com/2011/08/real-time-updating-comes-to-the-remember-the-milk-web-app |title=Real time updating comes to the Remember The Milk web app}}
116. ^{{cite web |url=https://www.verizon.com/jobs/santa-clara/network/jobid362082-scala-engineer-verizon-jobs/ |title=Senior Scala Engineer |accessdate=2014-08-18}}
117. ^{{cite web |url=https://venturebeat.com/2015/06/04/airbnb-introduces-aerosolve-a-open-source-machine-learning-software-package/ |title=Airbnb announces Aerosolve, an open-source machine learning software package |date=2015-06-04 |author=Novet, Jordan |accessdate=2016-03-09}}
118. ^{{cite web |url=https://www.slideshare.net/ZalandoTech/zalando-tech-from-java-to-scala-in-less-than-three-months |author=Kops, Alexander |title=Zalando Tech: From Java to Scala in Less Than Three Months |date=2015-12-14 |accessdate=2016-03-09}}
119. ^{{cite web |url=https://developers.soundcloud.com/blog/building-products-at-soundcloud-part-3-microservices-in-scala-and-finagle |author=Calçado, Phil |title=Building Products at SoundCloud—Part III: Microservices in Scala and Finagle |date=2014-06-13 |accessdate=2016-03-09}}
120. ^{{cite web |url=http://www.concurrentinc.com/customer/soundcloud/ |author=Concurrent Inc. |title=Customer Case Studies: SoundCloud |date=2014-11-18 |accessdate=2016-03-09}}
121. ^{{cite web |url=https://vimeo.com/147697498 |author=Skills Matter |title=Scala at Morgan Stanley (Video) |accessdate=2016-03-11|date=2015-12-03 }}
122. ^{{cite web |url=https://www.youtube.com/watch?v=THcAwoA5G2w |author=Greg Soltis |title=SF Scala, Greg Soltis: High Performance Services in Scala (Video) |accessdate=2016-03-11}}
123. ^{{cite web |url=https://www.scala-lang.org/old/node/11547.html |author=Lee Mighdoll |title=Scala jobs at Nest |accessdate=2016-03-11}}
124. ^{{ cite web |url=https://www.nurun.com/en/news/nurun-launches-redesigned-transactional-platform-with-walmart-canada/ |author=Nurun |title=Nurun Launches Redesigned Transactional Platform With Walmart Canada |accessdate=2013-12-11 }}
125. ^{{cite web |title=Rewriting Duolingo's engine in Scala |url=http://making.duolingo.com/rewriting-duolingos-engine-in-scala |author=André K. Horie |date=2017-01-31 |accessdate=2017-02-03}}
126. ^{{cite web |title=HMRC GitHub repository |url=https://github.com/hmrc?utf8=%E2%9C%93&q=&type=&language=scala}}
127. ^{{cite AV media |people=Krikorian, Raffi |date=17 March 2015 |title=O'Reilly Software Architecture Conference 2015 Complete Video Compilation: Re-Architecting on the Fly - Raffi Krikorian - Part 3 |medium=video |url=https://techbus.safaribooksonline.com/video/software-engineering-and-development/9781491924563 |access-date=8 March 2016 |time=4:57 |publisher=O'Reilly Media |quote=What I would have done differently four years ago is use Java and not used Scala as part of this rewrite. [...] it would take an engineer two months before they're fully productive and writing Scala code.}}
128. ^{{cite web |url=https://www.quora.com/Is-LinkedIn-getting-rid-of-Scala |title=Is LinkedIn getting rid of Scala? |last1=Scott |first1=Kevin |date=11 Mar 2015 |website=quora.com |access-date=25 January 2016}}
129. ^{{cite web |url=https://codahale.com/the-rest-of-the-story/ |title=The Rest of the Story |last1=Hale |first1=Coda |date=29 November 2011 |website=codahale.com |accessdate=7 November 2013}}

Further reading

{{Refbegin}}
  • {{Cite book

| first1 = Joshua D.
| last1 = Suereth
| date = Spring 2011
| title = Scala in Depth
| publisher = Manning Publications
| page = 225
| isbn = 978-1-935182-70-2
}}
  • {{Cite book

| first1 = Gregory
| last1 = Meredith
| year = 2011
| title = Monadic Design Patterns for the Web
| edition = 1st
| page = 300
| url = https://github.com/leithaus/XTrace/blob/monadic/src/main/book/content/monadic.pdf
}}
  • {{Cite book

| first1 = Dean
| last1 = Wampler
| first2 = Alex
| last2 = Payne
| date = 15 September 2009
| title = Programming Scala: Scalability = Functional Programming + Objects
| publisher = O'Reilly Media
| edition = 1st
| page = 448
| isbn = 978-0-596-15595-7
| url = https://oreilly.com/catalog/9780596155957/
}}
  • {{Cite book

| first1 = Martin
| last1 = Odersky
| first2 = Lex
| last2 = Spoon
| first3 = Bill
| last3 = Venners
| date = 21 April 2016
| title = Programming in Scala: A Comprehensive Step-by-step Guide
| publisher = Artima Inc
| edition = 3rd
| pages = 837/859
| isbn = 978-0-9815316-8-7
| url = https://www.artima.com/shop/programming_in_scala
}}
  • {{Cite book

| first1 = Martin
| last1 = Odersky
| first2 = Lex
| last2 = Spoon
| first3 = Bill
| last3 = Venners
| date = 10 December 2008
| title = Programming in Scala, First Edition, eBook
| publisher = Artima Inc
| edition = 1st
| url = https://www.artima.com/pins1ed
}}
  • {{Cite book

| first1 = Cay
| last1 = Horstmann
| date = March 2012
| title = Scala for the Impatient
| publisher = Addison-Wesley Professional
| edition = 1st
| page = 360
| isbn = 978-0-321-77409-5
| url = https://www.informit.com/title/0321774094
}}{{Refend}}{{Wikibooks|Scala}}{{-}}{{Java (Sun)}}{{Common Language Infrastructure}}{{Programming languages}}{{authority control}}

17 : Programming languages|Articles with example code|Concurrent programming languages|Free software programmed in Scala|Functional languages|Java programming language family|JVM programming languages|Object-oriented programming languages|Pattern matching programming languages|Programming languages created in 2003|Scala (programming language)|Scripting languages|Software using the Apache license|Statically typed programming languages|2003 software|Cross-platform free software|Free compilers and interpreters

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/11 18:56:36