Scala
A language that combines object-oriented and functional programming on the Java virtual machine.
27 steps across 1 tours, from the basics to complete programs.
The tours
- First released
- 2004
- Created by
- Martin Odersky
- Typing
- Static and inferred; everything is an expression, immutability is the default
- Snippets target
- 3.8
- File extensions
- .scala, .sc
What it is for
Scala is the language big data speaks: Apache Spark, Kafka, Akka, and Flink were all written in it, and every JVM shop that outgrew Java's ceremony keeps a Scala service or ten. It compiles to ordinary JVM bytecode and calls any Java library directly, which made it the lowest-risk way to bring functional programming into an enterprise — Twitter's feed, LinkedIn's pipelines, and most quantitative trading desks took that trade.
The language's bet is fusion rather than purity: objects and functions, static types and inference, so a one-line lambda and a thousand-class system both feel native. Pattern matching with exhaustiveness checking, case classes, and Option instead of null deliver most of the correctness dividend of stricter functional languages while still reading like code a Java developer can review.
Scala 3 (2021) was the biggest cleanup in the language's history: braceless indentation syntax, enums that finally say what an ADT means, extension methods replacing implicit-conversion tricks, and givens replacing the implicits that gave the language its scary reputation. The dialect these seeds drill is that modern core — the part that transfers to Kotlin, Rust, Swift, and every other language that has been quietly borrowing from it.
Where it came from
Martin Odersky had already written the compiler that became javac's generics support when he concluded Java could not be fixed from inside, and released Scala from EPFL in 2004: a language proving objects and functional programming belonged in one type system on the JVM.
Twitter's 2009 move from Ruby put Scala on the industry map, and the 2010s were its boom: Spark made it the language of big data, Akka of distributed systems, and version 2.8-2.13 grew the collections library into the standard others copy. The same decade earned it a complexity reputation, as implicits and operator-heavy libraries let codebases drift into dialects.
Scala 3, a decade in the making atop the DOT calculus that formally proved the type system sound, landed in 2021 with the new syntax, enums, and givens — and the ecosystem followed through the 2020s, with the LTS line these seeds compile against. The language now shares the pragmatic-functional space it invented with Kotlin, its own ideas visible in every rival.
What it is like to type
Scala 3 types clean and dense: no semicolons, few braces, but arrows everywhere — => in lambdas and match cases, -> in Map literals, <- in for comprehensions. The underscore does six jobs and s"${}" interpolation keeps the right hand busy. Indentation is structure now, so the two-space discipline of a match inside a def inside an if must land exactly, and case must line up under case.
27 steps across 1 tours, from the basics to complete programs.