The Artima Developer Community
Sponsored Link

Weblogs Forum
A Brief History of Scala

61 replies on 5 pages. Most recent reply: Jun 23, 2006 8:18 AM by James Watson

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 61 replies on 5 pages [ 1 2 3 4 5 | » ]
Martin Odersky

Posts: 84
Nickname: modersky
Registered: Sep, 2003

A Brief History of Scala (View in Weblogs)
Posted: Jun 9, 2006 8:03 AM
Reply to this message Reply
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")
}


Debasish Ghosh

Posts: 1
Nickname: dghosh
Registered: Oct, 2004

Re: A Brief History of Scala Posted: Jun 9, 2006 10:24 AM
Reply to this message Reply
Scala rocks !! I have been trying to evangelize Scala amongst the programming community. I like the solid advanced type system of Scala - Scala has really brought us the delights of all the functional as well as OO constructs within the framework of static typechecking. I have extensively blogged about some of the remarkable features of Scala. Pls see the following :

http://debasishg.blogspot.com/2006/04/scala-hosts-friendly-visit_114588689788249985.html
http://debasishg.blogspot.com/2006/04/generics-in-scala-part-1_12.html
http://debasishg.blogspot.com/2006/04/scala-compose-classes-with-mixins.html
http://debasishg.blogspot.com/2006/03/scale-up-with-scala.html
http://debasishg.blogspot.com/2006/03/scala-everything-is-object.html

Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: A Brief History of Scala Posted: Jun 9, 2006 11:39 AM
Reply to this message Reply
> Scala rocks !!
>
I'd like to add that I've been quite intrigued by Scala too. I have only read the documents, though. I haven't had time to actually play with writing code in it, but I was really happy that Martin wanted to start blogging about it here.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: A Brief History of Scala Posted: Jun 9, 2006 12:19 PM
Reply to this message Reply
One of my fears with Scala is that despite it's pragmatic basis (runs on JVM) it will remain a language only used by academics and uber-geeks and lack acceptance in the 'real-world'.

I plan to learn more anyway but clearly the interest I have is not unique and I see that as a fairly good sign.

Floyd Marinescu

Posts: 1
Nickname: fmarines
Registered: Jan, 2006

Re: A Brief History of Scala Posted: Jun 9, 2006 1:01 PM
Reply to this message Reply
Thanks for starting to blog about Scala. We did a news item about this on InfoQ:
http://www.infoq.com/news/Scala--combing-the-best-of-Ruby-

Ross Judson

Posts: 2
Nickname: rossjudson
Registered: Jul, 2004

Re: A Brief History of Scala Posted: Jun 9, 2006 1:02 PM
Reply to this message Reply
I've deployed a document transfer application written in Scala into a customer's environment. The client thinks that it is a regular Java application. Works for me :)

Bruce Eckel

Posts: 875
Nickname: beckel
Registered: Jun, 2003

Re: A Brief History of Scala Posted: Jun 9, 2006 1:05 PM
Reply to this message Reply
I've puzzled over how OO and functional languages might be combined, so Scala is intriguing.

One of the greatest strengths I perceive in functional languages is the solution to the concurrency problem (for readers: a call in a functional language has no side effects, so it can be executed as a separate task without worrying that it will conflict with other tasks).

Does Scala solve this problem?

Dick Ford

Posts: 149
Nickname: roybatty
Registered: Sep, 2003

Re: A Brief History of Scala Posted: Jun 9, 2006 2:11 PM
Reply to this message Reply
I'm interested in Scala, as well as a couple languages for the CLR - Boo and Nemerle. I'm curious how much of the compiler API is exposed through the compiler library in order to facilitate completion, refactoring, etc for an Eclipse plugin.

Boo and Nemerle expose much of the compiler API for this. But unless there's good IDE integration, I suspect many developers will pass it over.

Dick Ford

Posts: 149
Nickname: roybatty
Registered: Sep, 2003

Re: A Brief History of Scala Posted: Jun 9, 2006 2:21 PM
Reply to this message Reply
> I've puzzled over how OO and functional languages might be
> combined, so Scala is intriguing.
>
> One of the greatest strengths I perceive in functional
> languages is the solution to the concurrency problem (for
> readers: a call in a functional language has no side
> effects, so it can be executed as a separate task without
> worrying that it will conflict with other tasks).
>
> Does Scala solve this problem?

Scala isn't a pure functional language like Haskell or Clean. But programming in a more functional manner in Scala or Nemerle can help in finding opportunities for concurency.
In Nemerle the default variable type is immutable. So you have to annotate your real variables with the mutable keyword. I'm not sure about Scala though.

With dual cores hitting the mainstream machines now, functional-style programming should see a renewed interest.

Mark Engelberg

Posts: 3
Nickname: puzzler
Registered: Jun, 2006

Re: A Brief History of Scala Posted: Jun 9, 2006 4:18 PM
Reply to this message Reply
One of the fundamental reasons to want to merge object-oriented and functional programming is that object-orientation gives you a convenient mechanism for adding new datatypes that respond in different ways to various functions without messing with the original code, while functional programming gives you a convenient mechanism for adding new functions without messing with the original code.

The best technique I've seen for making both easy to do is multiple-dispatch object-oriented programming, i.e., multimethods. (Such as in the Dylan programming language).

I don't understand why Scala uses a single-dispatch object-oriented model, and I hope that Odersky will explain this design decision in a future article.

Dick Ford

Posts: 149
Nickname: roybatty
Registered: Sep, 2003

Re: A Brief History of Scala Posted: Jun 9, 2006 6:26 PM
Reply to this message Reply
> One of the fundamental reasons to want to merge
> object-oriented and functional programming is that
> object-orientation gives you a convenient mechanism for
> adding new datatypes that respond in different ways to
> various functions without messing with the original code,
> while functional programming gives you a convenient
> mechanism for adding new functions without messing with
> the original code.
>
> The best technique I've seen for making both easy to do is
> multiple-dispatch object-oriented programming, i.e.,
> multimethods. (Such as in the Dylan programming
> language).
>
> I don't understand why Scala uses a single-dispatch
> object-oriented model, and I hope that Odersky will
> explain this design decision in a future article.

It's disappointing that Apple didn't give Dylan more of a chance to get out there. It's still one of my favorite languages. I still think that separating data structures, functions/generic methods via multimethods, and a proper module system is a lot cleaner way to do OO than the Java/C# way.

There was a discussion about multimethods on the mailinglist either last month or in April. It didn't look promising though.

Martin Odersky

Posts: 84
Nickname: modersky
Registered: Sep, 2003

Re: A Brief History of Scala Posted: Jun 10, 2006 1:32 AM
Reply to this message Reply
> I've puzzled over how OO and functional languages might be
> combined, so Scala is intriguing.
>
> One of the greatest strengths I perceive in functional
> languages is the solution to the concurrency problem (for
> readers: a call in a functional language has no side
> effects, so it can be executed as a separate task without
> worrying that it will conflict with other tasks).
>
> Does Scala solve this problem?

Yes and no. Scala does not prevent side effects, but it makes it easier to program without them. There is also a library for actors which implement all the essentials of Erlang-style processes. This library is thread-based, and thus shares the usual restrictions of the JVM on number of threads. Another, as yet experimental, library for actors is event-based and scales up to hundreds of thousands of processes.

I'll write more on these soon.

Martin Odersky

Posts: 84
Nickname: modersky
Registered: Sep, 2003

Re: A Brief History of Scala Posted: Jun 10, 2006 1:36 AM
Reply to this message Reply
> I'm interested in Scala, as well as a couple languages for
> the CLR - Boo and Nemerle. I'm curious how much of the
> compiler API is exposed through the compiler library in
> order to facilitate completion, refactoring, etc for an
> Eclipse plugin.
>
There is actually a pretty decent Eclipse plugin for Scala.
It has syntax highlighting, automatic project builds, completion, but (not yet) refactoring. It will have debugger integration real soon now.
See: http://scala.epfl.ch/downloads/eclipse/index.html

Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: A Brief History of Scala Posted: Jun 10, 2006 11:53 AM
Reply to this message Reply
I am very pleased that you have started blogging here Martin, welcome aboard.

For those with doubts as to the potential for success of Scala, would do well to keep in mind the monstrous success of GJ.

Martin Odersky

Posts: 84
Nickname: modersky
Registered: Sep, 2003

Re: A Brief History of Scala Posted: Jun 10, 2006 2:56 PM
Reply to this message Reply
> The best technique I've seen for making both easy to do is
> multiple-dispatch object-oriented programming, i.e.,
> multimethods. (Such as in the Dylan programming
> language).
>
> I don't understand why Scala uses a single-dispatch
> object-oriented model, and I hope that Odersky will
> explain this design decision in a future article.

Thanks for the suggestion! I'll try to write something up about this soon. In short, I also think that multi-methods are appealing as a alternative for static overloading. The issue is whether one can do this switch from static to dynamic overloading and still stay compatible with all the existing Java libraries. Swing for example uses very intricate patterns of static overloading.

Flat View: This topic has 61 replies on 5 pages [ 1  2  3  4  5 | » ]
Topic: A Brief History of Scala Previous Topic   Next Topic Topic: Apprenticeship -- The untold story.

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use