Scala is a statically typed language for the JVM, first released in 2004 by Martin Odersky's lab at EPFL in Lausanne, Switzerland. Its name is short for "scalable language." The core of how Scala blends functional and object-oriented programming is simple to state: every value is an object, and every function is a value. That idea, worked out in serious type theory, gave the JVM its first widely used functional language.
Origins: from Pizza and javac to Scala
Odersky did his PhD under Niklaus Wirth at ETH Zurich, and he had spent the 1990s pushing Java toward better type systems. With Philip Wadler he created Pizza and then Generic Java (GJ), the work that became generics in Java 5. The GJ compiler was also adopted as Sun's official javac. Those experiences convinced him that Java itself could only change so much, so in 2001 he started a new language at EPFL. Scala was released publicly in early 2004, with Scala 2.0 following in 2006.
In 2011 Odersky co-founded Typesafe, later renamed Lightbend, to offer commercial support. The non-profit Scala Center at EPFL now coordinates much of the open-source work.
How Scala blends functional and object-oriented programming
On the object side, Scala has classes, singleton objects and traits, which work like interfaces that can carry code and state and be mixed into classes. There are no primitive types or static members in the language model; 1 + 2 is a method call on an Int object.
On the functional side, Scala offers first-class functions, immutable collections by default, case classes with pattern matching, sealed hierarchies for algebraic data types, and for-comprehensions for working with options, futures and other containers. Its type system adds generics with variance annotations, higher-kinded types and strong type inference, so most local types never need to be written.
A short Scala 3 example
This uses a sealed trait, case classes, pattern matching with guards and the optional-braces syntax introduced in Scala 3:
sealed trait Shape:
def area: Double
case class Circle(r: Double) extends Shape:
def area: Double = math.Pi * r * r
case class Rect(w: Double, h: Double) extends Shape:
def area: Double = w * h
def describe(s: Shape): String = s match
case Circle(r) if r > 10 => "large circle"
case Circle(_) => "circle"
case Rect(w, h) if w == h => "square"
case Rect(_, _) => "rectangle"
@main def run(): Unit =
val shapes = List(Circle(1), Rect(2, 2), Circle(12))
shapes.foreach(s => println(f"${describe(s)}: ${s.area}%.2f"))
Versions and milestones
| Year | Release | Highlights |
|---|---|---|
| 2004 | First public release | JVM implementation from EPFL |
| 2006 | Scala 2.0 | Compiler rewritten in Scala |
| 2010 | Scala 2.8 | Redesigned collections library |
| 2019 | Scala 2.13 | Simplified collections |
| 2021 | Scala 3.0 | New compiler (Dotty), given/using, enums, optional braces |
Scala 3 is based on the DOT calculus, a formal foundation for Scala's type system. It replaced the much-criticized implicits with clearer given and using clauses. Scala also targets JavaScript through Scala.js and native binaries through Scala Native.
Where Scala is used today
Scala's big break came around 2009, when Twitter moved parts of its back end from Ruby to Scala on the JVM and later open-sourced libraries such as Finagle. Since then its most important role has been in data infrastructure:
- Apache Spark, started at UC Berkeley's AMPLab, is written in Scala, and its Scala API is the most complete.
- Apache Kafka, created at LinkedIn, was written largely in Scala and Java.
- Akka brought Erlang-style actors to the JVM. After its 2022 license change, the Apache-licensed fork Apache Pekko appeared.
- Functional libraries such as Cats and ZIO serve teams building typed, effect-based back ends.
- Chisel, a hardware construction language embedded in Scala, is used to design RISC-V chips.
Influence
Scala showed Java developers that type inference, lambdas, pattern matching and immutable data could work in production on the JVM. Kotlin's designers drew on Scala while aiming for something simpler, and Java's own lambdas, records, sealed classes and pattern matching follow a path Scala explored years earlier.
Should you learn Scala?
Learn Scala if you work with Spark and large data pipelines, or if you want to go deep into typed functional programming without leaving the JVM. The learning curve is real, and build times and library choices can frustrate beginners. But understanding how Scala blends functional and object-oriented programming will change how you write code in Java, Kotlin or TypeScript too.
Frequently asked questions
Is Scala a functional or an object-oriented language?
It is both by design. Every value is an object with methods, and functions are themselves objects that can be passed around. You can write Scala in an almost Java-like style or in a purely functional one, and many codebases mix the two.
Is Scala 3 compatible with Scala 2 code?
Mostly. Scala 3 can use libraries compiled with Scala 2.13, and migration tools handle many syntax changes. Code that relied on Scala 2 macros or heavy implicit tricks usually needs the most work.
Do you need Scala to use Apache Spark?
No. Spark also has Python, Java, R and SQL interfaces, and PySpark is very widely used. Scala remains useful because Spark itself is written in it and new internals usually appear there first.







