Paradigm | Multi-paradigm: concurrent, functional, imperative, object-oriented |
---|---|
Designed by | Martin Odersky |
Developer | Programming Methods Laboratory of École Polytechnique Fédérale de Lausanne |
First appeared | 20 January 2004 |
Stable release | 3.5.0[1]
/ 22 August 2024 |
Typing discipline | Inferred, static, strong, structural |
Implementation language | Scala |
Platform | Java virtual machine (JVM) JavaScript (Scala.js) LLVM (Scala Native) (experimental) |
License | Apache 2.0[2] |
Filename extensions | .scala, .sc |
Website | www |
Influenced by | |
Common Lisp,[3] Eiffel, Erlang, F#, Haskell,[4] Java,[5] OCaml,[5] Oz, Pizza,[6] Scheme,[5] Smalltalk, Standard ML[5] | |
Influenced | |
Ceylon, Chisel, Fantom, F#, C#, Kotlin, Lasso, Red, Flix | |
|
Scala (/ˈskɑːlɑː/ SKAH-lah)[7][8] is a strong statically typed high-level general-purpose programming language that supports both object-oriented programming and functional programming. Designed to be concise,[9] many of Scala's design decisions are intended to address criticisms of Java.[6]
Scala source code can be compiled to Java bytecode and run on a Java virtual machine (JVM). Scala can also be transpiled to JavaScript to run in a browser, or compiled directly to a native executable. When running on the JVM, Scala provides language interoperability with Java so that libraries written in either language may be referenced directly in Scala or Java code.[10] Like Java, Scala is object-oriented, and uses a syntax termed curly-brace which is similar to the language C. Since Scala 3, there is also an option to use the off-side rule (indenting) to structure blocks, and its use is advised. Martin Odersky has said that this turned out to be the most productive change introduced in Scala 3.[11]
Unlike Java, Scala has many features of functional programming languages (like Scheme, Standard ML, and Haskell), including currying, 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), anonymous types, operator overloading, optional parameters, named parameters, raw strings, and an experimental exception-only version of algebraic effects that can be seen as a more powerful version of Java's checked exceptions.[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]
{{cite web}}
: Missing or empty |title=
(help)
The creators of Scala actually pronounce it scah-lah, like the Italian word for "stairs." The two "a"s are pronounced the same.