Daniel Steinberg interviews Bill Venners about the Scala language in the podcast, Bill Venners on the Rise of Scala. Bill Venners is co-author, along with Martin Odersky and Lex Spoon, of the book Programming in Scala, a PrePrint edition of which was recently published by Artima.
I've been using Java since 1996, and have been very happy with it. But I think there is a natural law of languages that [says] that [a language] over time becomes harder and harder to enhance while still maintaining backwards compatibility. If a language is as successful as Java, it's really expensive to break source compatibility with Java in subsequent releases of the language. It becomes harder and harder to improve things... And it comes a time when it may make sense to jump to a language that is not source compatible, but is binary compatible.
One of things I had been looking around for was a more light-weight way to write some of our code. I was looking at Groovy, and JRuby and Jython—things that would run on the JVM, and would still allow us to leverage all of our [Java] code that we've written, all the great libraries that are in the Java ecosystem..., but allow me to get some of the speed and conciseness... Programmer productivity is what I was trying to get at looking at other languages for the Java platform.
But the trouble was that I really like static type-checking, and I could never make the leap to one of these languages... That's when I learned about Scala. I realized that it was more of a fit for us. It gives you all the conciseness that you get with Ruby, or Groovy, or Jython. When you're programming in [Scala], you feel like you're programming in a scripting language, but Scala actually gives you more static type checking than Java.
I felt so jealous at people who were using Ruby or Python because they are so happy and so productive... But I didn't want to give up static type checking...
The name Scala comes from SCAlable LAnguage. One way it's scalable is that it scales to different-size tasks and different domains... Scala has a small kernel of features that you can build on. For example, if you want to use it to interact with databases, then it allows you to build a very natural API and library to talk to databases. Scala is very malleable. It scales all the way down to scripts—you can actually use it as a scripting language. That's how I started using it.
There are a lot of people out there who have investment in Java: They have code and knowledge, so [Scala] running on the JVM means they can leverage all their code, all the libraries they wrote, all the libraries they've been using from vendors or open-source projects, things they're familiar with.
The Java ecosystem is innovative—there are all these things coming out of it. And Scala is part of that ecosystem—it's an innovative language piece. You don't have to stop using Java.
It's a Scala tutorial, so it's there to teach people to learn to program in Scala. But it's more than that. We want to make it into a book about how to program well. Every language leads you in certain directions, [and] we want to help people improve their programming skills, improve their game. By learning [Scala], even if you're not using it, it will change how you approach programming.