The Scala Language

Scala (a contraction of "scalable language") is a statically typed, multi-paradigm programming language created by Martin Odersky at EPFL and first released in 2004. Its defining idea is to fuse object-oriented programming (in the lineage of Smalltalk) and functional programming (in the lineage of Lisp) into a single, coherent type system — rather than bolting one onto the other.

Scala primarily targets the Java Virtual Machine (JVM): it compiles to Java bytecode and interoperates seamlessly with the entire Java ecosystem, so any Java library is a Scala library. It can also compile to JavaScript (Scala.js) for the browser and to native binaries via LLVM (Scala Native). The pitch, in one line: the reach and tooling of the JVM, with the expressiveness and safety of a modern functional language and one of the most powerful type systems in mainstream use.

Scala 3 — originally the "Dotty" research compiler and released in 2021 — was a substantial redesign of the language. Much of this page reflects Scala 3, noting where it differs from the still-widely-used Scala 2.

A taste of Scala

// Algebraic data type via a Scala 3 enum
enum Shape:
  case Circle(r: Double)
  case Rect(w: Double, h: Double)

// Pattern matching; `match` is an expression that returns a value
def area(s: Shape): Double = s match
  case Shape.Circle(r)  => math.Pi * r * r
  case Shape.Rect(w, h) => w * h

val shapes = List(Shape.Circle(1.0), Shape.Rect(2, 3)) // immutable `val`
val total  = shapes.map(area).sum                      // higher-order function + reduce

In a dozen lines this shows several of Scala's signatures: algebraic data types (enum), exhaustive pattern matching, type inference (no type annotations on shapes/total), an expression-oriented style where even match yields a value, immutable values by default (val), a rich collections library (map, sum), and Scala 3's optional-braces, indentation-based syntax.

What defines Scala

Ecosystem and tooling

How Scala compares

Scala occupies the "maximally expressive, statically typed, JVM" corner of the design space. The clearest way to understand it is to line it up against three languages teams often weigh it against.

Scala vs Java

Similar: Both run on the same JVM — identical bytecode, garbage collector, and threading model — and interoperate in both directions, drawing on the same Maven ecosystem. Both are statically typed and fundamentally object-oriented (classes, inheritance, exceptions).

Different:

In short: reach for Scala when Java's expressiveness ceiling is your bottleneck; reach for Java when team size, hiring, and simplicity dominate.

Scala vs Go

Similar: Both are statically typed, compiled, garbage-collected languages widely used for backend services and data/infrastructure, and both treat concurrency as a first-class concern.

Different (their philosophies are nearly opposite):

Scala vs Python

Similar: Both are high-level, multi-paradigm, and concise, with strong REPL-driven workflows and first-class functional idioms (Python's comprehensions map closely to Scala's for-comprehensions). Both are central to data work, and Apache Spark exposes both (Scala natively, Python via PySpark).

Different:

In data work specifically: Python is the language of exploration, ML, and glue; Scala is the language of high-throughput, type-safe pipelines (and of Spark's own internals). A common "polyglot" division of labor puts Scala in the core data infrastructure and Python in the analytics/ML layer on top.

At a glance

DimensionScalaJavaGoPython
TypingStatic, inferred, very richStatic, verboseStatic, minimalDynamic (+ optional hints)
ParadigmOOP + FP fusionOOP (FP features added)Imperative + structural interfacesMulti-paradigm
RuntimeJVM (also JS / native)JVMNative binary + light runtimeInterpreted (CPython)
ConcurrencyThreads, Futures, actors, effects; LoomThreads; Loom virtual threadsGoroutines + channels (built-in)Threads (GIL), async, multiprocessing
PerformanceHigh (JIT)High (JIT)High; fast startup, low memoryLower; relies on C extensions
Compile / startupSlow compile, JVM startupFast compile, JVM startupVery fast compile, instant startupNo compile; instant start
ConcisenessVery highModerate (improving)Moderate, intentionally plainVery high
Learning curveSteepModerateGentleGentle
Typical sweet spotData engineering (Spark), complex domainsEnterprise apps, AndroidCloud-native infra, CLIs, microservicesData science/ML, scripting, web

Scala 2 vs Scala 3

Scala 3 (2021) modernized the language: optional-braces/indentation syntax, given/using in place of implicits, native enums, opaque types, union/intersection types, trait parameters, and a safer metaprogramming model. Scala 2 (especially 2.13) remains common in industry, and migration is ongoing — interop between the two is strong but not seamless, so real codebases often straddle both for a while. For new projects, Scala 3 is the default choice.

Where Scala is used

Scala is a "narrow but deep" language: a smaller community than Java or Python, but entrenched where its strengths matter.

Frequently Asked Questions

Is Scala object-oriented or functional? Both — by design. Scala unifies the two paradigms in one type system, so a Scala program can be written in an imperative-OOP style, a purely functional style, or (most commonly) a pragmatic blend.

Is Scala still relevant in 2026? Yes, though as a specialist language rather than a mainstream default. It remains entrenched in data engineering (largely through Spark) and in typed-functional backends, with a smaller but high-skill community compared to Java and Python.

Scala vs Java — which is faster? Broadly comparable: both compile to JVM bytecode and run on the same JIT. The real differences are expressiveness, conciseness, and style — not raw throughput.

Should I learn Scala 2 or Scala 3? Learn Scala 3 for new work, but expect to encounter plenty of Scala 2 code in existing projects.

Do I need Scala to use Apache Spark? No — PySpark lets you use Spark from Python, and there are SQL and R interfaces too. But Scala is Spark's native language and is preferred for performance-critical jobs and custom UDFs.


See Also: