Tuesday, June 17, 2008

Scala Light... A Java successor?

Upon reading on a few forums in Artima, I detected a desire for both a fuller Java and a simpler Scala. A fuller Java to have things like type inference and more functional style constructs. A simpler Scala to be have an easier specification, both for the mind and for the IDE.

What do you think would be more appropriate to help Java developers get a better language?
  • Continue to selectively better the Java Language
  • Define a subset of Scala, a Scala Light if you will. Or would a subset of Scala defeat the purpose of its synergy of features?
  • Another choice

10 comments:

nils said...

Oh man, you are sure to get some hating from the hardcore Scala crowd.
Anyway, I too am daunted by the complexity, implicitness, and seemingly multiple ways to do the same thing in Scala. A phrase like "Scala Light" seems alluring although I don't know enough about the language to know if that's possible. Pattern matching has me particularly worried, as it brings back the switch/case statements we all should hate. Certainly pattern matching is extremely powerful, and seemingly very usable, but it carries the danger of people using it for instance-of checks, for which double dispatch should be used instead, to ensure full consistent coverage of living code.
Anyway, interesting and dangerous suggestion.

The Careful Programmer said...

Hi nils,

Thank you for your comments.

I am really trying not to start any kind of flame war. I hope readers will see this is just an invitation to, hopefully calm, speculations 8)

The Careful Programmer said...

Also, just for the records, I am perfectly happy with Scala the way it is. I am not suggesting changing Scala itself in anyway, but rather "sprouting" a variant that could be appealing for different usages maybe.

I am happy using Scala at home, and I am (mostly) happy using Java at work, although I do miss closures. On that front, I still have to take a look at the jedi library and closures could be in Java in a few iterations more.

patrickdlogan said...

My 2c...

1. Leave java _alone_ -- it has problems, but let it continue as-is.

2. Let Scala evolve -- all the features, type systems, etc. Scala is somewhat of a proving ground for a "modern java".

3. Rather than "scala lite" -- I would say just use the other end of the jvm-based-language spectrum, i.e. Groovy.

Groovy is a fairly lite Java replacement, Scala is a fairly heavy Java replacement. They both work with Java fairly well.

retiman said...

I'm not sure I understand; what exactly is "heavy" about Scala?

Cedric said...

Fan looks promising:

http://beust.com/weblog/archives/000488.html

--
Cedric

Ricky Clarkson said...

Scala isn't as difficult as you might think. I found that I could easily get started writing Scala code and gradually use more and more features, though to date I haven't pushed traits or self types very far, probably because I don't like OOP. I've probably used most of the other features now though, except the actors and parser combinator libraries.

I possibly had an advantage over some, through knowing Java and half of Haskell.

Ricky Clarkson said...

And one more thing, I'm not sure why you would switch to Groovy over Scala or even Java. It doesn't even support static typing.

The Careful Programmer said...

I think heavy is meant in the sense of complex.

There are many edge cases:
Why not Scala?
By David R. MacIver

See also the following interview between Frank Sommers and Dmitry Jemerov:
JetBrains' Dmitry Jemerov on IntelliJ 8, Flex, and Scala

Dmitry Jemerov and Martin Odersky both agree that Scala is complex, although Martin Odersky makes the point (from vast experience), that it is easy to learn:
"Regarding Scala complexity: It's true that Scala is quite a difficult language to implement, and I have a lot of respect for JetBrains' determination to write a complete compiler for it. But in my experience it's generally not a very difficult language to learn. I speak from experience: I have been teaching many hundreds of undergrads in it, and received overwhelmingly positive feedback."

It is this complexity, both for the IDE makers and for the language users, that I sense is repelling some away from Scala.

Maybe as some programming ideas are becoming mainstrean like functional programming, more people will get interested in Scala.

I have yet to dive deep enough or wide enough in Scala to get an overall picture.

Meanwhile, I still wonder if a lighter (yes less complex would also mean less porwerful, I know) alternative would be better suited to succeed Java, particularly in the enterprise world.

Ricky Clarkson said...

Actually it's not true that less complex equals less powerful.