Scala (programming language)

Scala (/ˈskɑːlə/ SKAH-lah) is a strong statically typed high-level general-purpose programming language that supports both object-oriented programming and functional programming. Designed to be concise, many of Scala's design decisions are intended to address criticisms of Java.

Scala
ParadigmMulti-paradigm: concurrent, functional, imperative, object-oriented
Designed byMartin Odersky
DeveloperProgramming Methods Laboratory of École Polytechnique Fédérale de Lausanne
First appeared20 January 2004 (2004-01-20)
Stable release
3.3.1 LTS  / 9 September 2023 (9 September 2023)
Preview release
3.1.2-RC3  / 24 March 2022 (24 March 2022)
Typing disciplineInferred, static, strong, structural
Implementation languageScala
PlatformJava virtual machine (JVM)
JavaScript (Scala.js)
LLVM (Scala Native) (experimental)
LicenseApache 2.0
Filename extensions.scala, .sc
Websitewww.scala-lang.org
Influenced by
Common Lisp, Eiffel, Erlang, F#, Haskell, Java, OCaml, Oz, Pizza, Scheme, Smalltalk, Standard ML
Influenced
Ceylon, Chisel, Fantom, F#, C#, Kotlin, Lasso, Red, Flix

Scala source code can be compiled to Java bytecode and run on a Java virtual machine (JVM). Scala can also be compiled to JavaScript to run in a browser, or directly to a native executable. 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. 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.

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.

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

This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.