Aug 6, 2010

Dr. Martin Odersky, the lead designer/developer of the Scala Programming Language, Generic Java, and Pizza requires no introduction, but the motivation for this micro-interview does. That is, there is an unfortunate view in some circles that sees the existence of Scala and Clojure as somehow being at odds. In chatting with Dr. Odersky it is my hope to dispel the notion that there is a need for ill-will. I would like to quote Brenton Ashworth, as he sets the tone nicely:

We should choose languages based on how accurately they allow us to think about the problems we are trying to solve. — Brenton Ashworth

Not only is the mutual existence of Scala and Clojure important, it is indeed absolutely vital. As it happens, Clojure more closely fits the shape of my own thoughts and ways of working, but Scala serves as muse for a great minds like Daniel Spiewak and Jonas Bonér. I could continue along this train of thought, but I think that Dr. Odersky makes a better point than I could.

In order for Scala to “win”, does Clojure need to “lose”?

No, this is silly. Let’s be realistic. Functional programming is still far from being mainstream. A lot of hard work is needed to get it there. And infighting will just damage the adoption of functional programming as a whole. By contrast, any win of a functional language in an enterprise raises the credibility of all other functional languages. We should help each other, not fight each other.1

What are your thoughts about Clojure?

I have not programmed in Clojure. From what I can see it is a very well put together language, that brings the power of Lisp to the JVM in a practical package. There are things we liked so much in Clojure that we copied2 them, for instance the data structures for sequences and hash-tries. I believe there are, and will be, many other areas of fruitful cross-pollination3.

Both Clojure and Scala are clearly influenced by Haskell, ML, Chris Okasaki, and Phil Bagwell. However, are there common influences that might not be as apparent?

Erlang was the template after which Scala’s actor’s library was modeled and it might have influenced Clojure’s agents as well. Lisp, Scheme and Prolog had some indirect influences to Scala. But the tricky part of any language design in Scala is really getting the static types right, so in that sense Haskell, SML, OCaml and F# had a stronger influence. Then of course there’s Java which as the primary host language influences what’s possible in Scala and Clojure to no small degree.

Rich Hickey is as well-read in the academic papers as anyone, but it’s Scala that has gained the perception as an “academic language”. Why do you think that has happened?

I think it’s mostly people who want to put Scala down making that comment. They take my EPFL affiliation and the papers4 we publish as an excuse to attach that label to the language. What’s funny is that often senior industrial Scala programmers get also accused as being academic. All this is rather ironical because Scala is foremost an industrial language5 with many well known companies using it. By contrast it’s much less taught at universities than Haskell or Lisp, let alone Java!

I’ve found many Scala and Haskell programmers who posses an extremely acute sense of humor. Is it static typing that attracts these minds, or does it create them?

Maybe it’s the creative pauses forced on them when they wait for the type-checker to finish ;-)