History
History
The language was announced in November 2009. It is used in some of Google's production
systems, as well as by other firms.[15]
Two major implementations exist:
Types[edit]
Go has a number of built-in types, including numeric ones (byte, int64, float32,
etc.), booleans, and character strings (string). Strings are immutable; built-in operators and
keywords (rather than functions) provide concatenation, comparison, and UTF-8 encoding and
decoding.[32] Record types can be defined with the struct keyword.[citation needed]
For each type T and each non-negative integer constant n, there is an array
type denoted [n]T; arrays of differing lengths are thus of different types. Dynamic arrays are
available as "slices", denoted []T for some type T. These have a length and
a capacity specifying when new memory needs to be allocated to expand the array. Several
slices may share their underlying memory.[33][34][35]
Pointers are available for all types, and the pointer-to-T type is denoted *T. Address-taking and
indirection use the & and * operators as in C, or happen implicitly through the method call or
attribute access syntax.[36] There is no pointer arithmetic, except via the
special unsafe.Pointer type in the standard library.[citation needed]
For a pair of types K, V, the type map[K]V is the type of hash tables mapping type-K keys to
type-V values. Hash tables are built into the language, with special syntax and built-in
functions. chan T is a channel that allows sending values of type T between concurrent Go
processes.[citation needed]
Aside from its support for interfaces, Go's type system is nominal: the type keyword can be
used to define a new named type, which is distinct from other named types that have the same
layout (in the case of a struct, the same members in the same order). Some conversions
between types (e.g., between the various integer types) are pre-defined and adding a new type
may define additional conversions, but conversions between named types must always be
invoked explicitly.[37] For example, the type keyword can be used to define a type
for IPv4 addresses, which are 32-bit unsigned integers.[citation needed]
Scala
Scala (/skl/ 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 both languages 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.
The name Scala is a portmanteau of scalable and language, signifying that it is designed to
grow with the demands of its users
History
The design of Scala started in 2001 at the cole Polytechnique Fdrale 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.[13] Odersky formerly worked on Generic Java, and javac, Sun's Java compiler.[13]
After an internal release in late 2003, Scala was released publicly in early 2004 on the Java
platform,[14][8][13][15] A second version (v2.0) followed in March 2006.[8]
Although Scala had extensive support for functional programming from its inception, Java
remained a mostly object oriented language until the inclusion of lambda expressions with Java
8 in 2014.
On 17 January 2011 the Scala team won a five-year research grant of over 2.3 million from
the European Research Council.[16] 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.