Article Discussion
The Goals of Scala's Design
Summary: Martin Odersky talks with Frank Sommers and Bill Venners about the compromises and most important goals in Scala's design, its object-oriented innovations, and what's in it for you.
18 posts on 2 pages.      
« Previous 1 2 Next »
The ability to add new comments in this discussion is temporarily disabled.
Most recent reply: June 2, 2009 3:01 PM by Raoul
Martin
Posts: 15 / Nickname: modersky / Registered: September 14, 2003 9:46 PM
Re: The Goals of Scala's Design
May 22, 2009 5:15 AM      
> About multimethods, it is said
> """
> We might have wanted to experiment with something more
> radical such as multi-methods, [...]. It would have been
> an exciting possibility to explore, but we didn't do it
> because we wanted to stay compatible with Java.
> """
>
> I don't understand: the Nice language had multimethods for
> many years and it was still compatible with java, so why
> where they considered incompatible with java when
> designing scala?

Well there's compatible and compatible. For instance Swing uses static overloading in really wild ways. Can we guarantee that a multi-method scheme would still always resolve correctly? Can we guarantee that one can write new Swing components that always work correctly? Maybe we can, but I just don't know for sure. I would have liked to have had the time to explore this in depth when Scala was first designed.

What scared me off at that time was that MultiJava had both multi-methods and a separate static overloading mechanism.
Given that this is rather clunky and MultiJava's designers are bright people, the only reason for them doing this that I could imagine was compatibility problems. But I might have been too paranoid.

Btw, are there signficant applications using Swing in Nice (inluding ones that define their own components)? If yes, that would be a good indicator that the problems are more mangeable than I feared.
James
Posts: 128 / Nickname: watson / Registered: September 7, 2005 3:37 AM
Re: The Goals of Scala's Design
May 26, 2009 5:36 AM      
I was not sure about pattern matching at first and I'm still not completely sure I understand how to use it to it's full potential but it's clear that it does everything you can do with multi-methods and more. It's more explicit than multi-methods too. If I had my druthers, I'd get rid of method overloading completely in Scala. It's been one of the biggest sources of hair-pulling for me in my Java career and doesn't provide any real benefits.
Raoul
Posts: 20 / Nickname: raoulduke / Registered: April 14, 2006 11:48 AM
Re: The Goals of Scala's Design
June 2, 2009 3:01 PM      
> but it's clear that it does everything
> you can do with multi-methods and more.

hmmm.
18 posts on 2 pages.
« Previous 1 2 Next »