The Artima Developer Community
Sponsored Link

Ideas, Languages, and Programs
A Brief History of Scala
by Martin Odersky
June 9, 2006
Summary
A quick introduction where I come from and what led up to Scala.

Advertisement

This is my first blog at Artima.com. I'll be writing mostly about language design and the Scala programming language.

But first, let me introduce myself. At university, I had my first programming class (in Algol60, no less! -- I believe we were the last class to be taught in that language). Whenever my program had a syntax error, the TA of the course mumbled something about my program not passing the compiler. I deduced that a compiler would be a sort of small computer that would be sitting between my teletype and the real computer. Its task would be to prepare my program so that the real computer could concentrate on the hard part, which would be executing the program I wrote. It seemed to me at the time that compilation was much simpler than, say, evaluating a polynomial with Horner's rule.

When I found out what a compiler really was, I was hooked. I went on to write compilers for Pascal and Modula-2. Afterwards, I joined Niklaus Wirth's group at ETH Zuerich as a Ph.D. student, working on Modula-2 and Oberon. After that, I fell in love with functional programming and wrote a lot of papers on calculi and type systems for functional programming languages (most of them are on my website).

In 1995 I learned about Java and teamed up with Philip Wadler to write a functional language that compiles to Java bytecodes. This work on Pizza led eventually to GJ, the new javac compiler, and Java generics. It was exciting to do work on Java because of its huge impact, but it was also very difficult because Java is a rich language with many features which often conflict with extensions in unforeseen ways.

In 1999, I joined EPFL. I thought that I would now use my academic freedom to do language design starting from a clean sheet. I still wanted to combine functional and object-oriented programming, but without the restrictions imposed by Java. I had found out about join calculus, and believed that this would be a great foundation on which to base such a unification. The result was Funnel, a programming language for functional nets. This was a beautifully simple design, with very few primitive language features. Almost everything, including classes and pattern matching, would be done by libraries and encodings.

However, it turned out that the language was not very pleasant to use in practice. Minimalism is great for language designers but not for users. Non-expert users don't know how to do the necessary encodings, and expert users get bored having to do them over and over again. Also, it became quickly apparent that any new language has a chance of being accepted only if it comes with a large set of standard libraries.

Funnel led to Scala, whose design began in 2001, and which was first released in 2003. Scala is not an extension of Java, but it is completely interoperable with it. Scala translates to Java bytecodes, and the efficiency of its compiled programs usually equals Java's. A second implementation of Scala compiles to .NET. (this version is currently out of date, however).

Scala was designed to be both object-oriented and functional. It is a pure object-oriented language in the sense that every value is an object. Objects are defined by classes, which can be composed using mixin composition. Scala is also a functional language in the sense that every function is a value. Functions can be nested, and they can operate on data using pattern matching.

The Scala user community is still relatively small, but it's growing. We currently see about 1000 downloads per month of the Scala distribution on our website.

I'll write more about specific aspects of Scala in the coming blogs. For now I log off with the "hello-world" program written in Scala:

object HelloWorld extends Application {
  Console.println("Hello World")
}

Talk Back!

Have an opinion? Readers have already posted 61 comments about this weblog entry. Why not add yours?

RSS Feed

If you'd like to be notified whenever Martin Odersky adds a new entry to his weblog, subscribe to his RSS feed.

About the Blogger

Martin Odersky is the inventor of the Scala language and professor at EPFL in Lausanne, Switzerland. In 2008, he was appointed fellow of the ACM for his contributions to the fusion of functional and object-oriented programming. He believes the two paradigms are two sides of the same coin, to be unified as much as possible. To prove this, he has worked on a number of language designs, from Pizza to GJ to Functional Nets. He has also influenced the development of Java as a co-designer of Java generics and as the original author of the current javac reference compiler.

This weblog entry is Copyright © 2006 Martin Odersky. All rights reserved.

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us