The Origins of Scala (2009)
Source: Hacker News
by Bill Venners and Frank Sommers – May 4 2009
Summary
Martin Odersky talks with Bill Venners about the history that led to the creation of the Scala programming language.
Discovering a fascination with compilers
Bill Venners: Let’s start at the beginning. How did you first become involved with programming languages?
Martin Odersky: My favorite subject was always compilers and programming languages. When I first discovered what a compiler was, as an undergrad in 1980, I immediately wanted to build one. The only computer I could remotely afford at the time would have been a Sinclair ZX 80 with one kilobyte of RAM. Fortunately, I soon got access to a much more powerful machine, an Osborne‑1 – the world’s first “portable” (luggable) computer. It had a five‑inch screen displaying 52 characters per line, 56 KB of usable RAM and two 90 KB floppy drives.
In those days I worked with another student, Peter Sollich, on a Modula‑2 compiler for 8‑bit Z80 computers. The Osborne only shipped with Microsoft BASIC, which lacked procedures with parameters, so we used a classic bootstrapping technique: Peter wrote a tiny Pascal subset compiler in Z80 assembly, we used it to compile a slightly larger language, and repeated the process until we could compile full Modula‑2. The resulting system could produce interpreted bytecode (the most compact at the time) as well as native Z80 binaries.
Just before we finished, Borland released Turbo Pascal and considered a Modula‑2 product. They bought our compiler to sell as Turbo Modula‑2 for CP/M and planned an IBM‑PC version. The PC version was delayed, eventually emerging years later as TopSpeed Modula‑2, but without Borland’s marketing push it remained obscure.
When the compiler was done, Borland offered both Peter and me jobs. Peter accepted; I stayed at university to finish my classes and a master’s project on incremental parsing. That research experience led me to pursue a Ph.D. with Niklaus Wirth (inventor of Pascal and Modula‑2) at ETH Zurich.
Working to improve Java
Bill Venners: How did Scala come about? What is its history?
Martin Odersky: Around 1988/89, while in Zurich, I became fascinated with functional programming. I later became a professor in Karlsruhe, Germany, working on theoretical topics like call‑by‑need lambda calculus with Phil Wadler (University of Glasgow). Phil told me about a new language called Java, which was portable, byte‑code based, web‑ready, and garbage‑collected. He warned that Java could “bury” us.
Phil and I decided to bring functional ideas to the Java world, creating Pizza (1996). Pizza added three functional features to Java: generics, higher‑order functions, and pattern matching. It demonstrated that functional language features could be implemented on the JVM.
We then collaborated with Gilad Bracha and David Stoutamire from Sun’s core team, producing GJ (Generic Java) in 1997/98. Six years later GJ’s ideas became Java 5 generics, with later additions such as wildcards (developed independently by Bracha and researchers at Aarhus).
Sun liked the GJ compiler we wrote; it proved more stable than their original javac. Consequently, Sun adopted the GJ compiler as the standard javac starting with the Java 1.3 release (2000).
Designing a language better than Java
Martin Odersky: During the Pizza and GJ work I often felt frustrated: Java’s existing constraints prevented many of the designs I wanted. After focusing on improving Java, I decided to start from a clean sheet while still leveraging the JVM and its libraries—bootstrapping from nothing would be impractical.
Becoming a professor at EPFL gave me the freedom to assemble a small research group without constant grant chasing. Initially we pursued a radical approach, building on the join calculus (a beautiful concurrency model). We created an object‑oriented version called Functional Nets and a language named Funnel. However, we soon realized that Funnel’s purity made it unsuitable for practical use, leading us to rethink our direction…