The Artima Developer Community
Sponsored Link

Artima Developer Spotlight Forum
Groovy Creator James Strachan on Scala

69 replies on 5 pages. Most recent reply: Jun 14, 2011 6:47 PM by Wanderson Santos

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 69 replies on 5 pages [ 1 2 3 4 5 | » ]
Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

Groovy Creator James Strachan on Scala Posted: Jul 7, 2009 2:33 AM
Reply to this message Reply
Advertisement

In a recent blog post, Scala as the long term replacement for java/javac?, Groovy creator James Strachan writes of his quest to find a language with all the benefits of Java, but with few of Java's shortcomings:

I've written tons of Java over the last decade or so & think its been a great evolutionary step from C++ and Smalltalk (lots of other languages have helped too like JavaScript, Ruby, Groovy, Python etc). However I've long wanted a long term replacement to javac. I even created a language to scratch this itch...

This issue becomes even more pressing with there being no Java7 (which is even more relevant after Snorcle - I wonder if javac is gonna be replaced with jdkc? :). So I guess javac has kinda reached its pinacle; closures look unlikely as does any kind of simplification or progression...

So whats gonna be the long term replacement for javac? Certainly the dynamic languages like Ruby, Groovy, Python, JavaScript have been getting very popular the last few years - lots of folks like them.

Though my tip though for the long term replacement of javac is Scala...

I'm very impressed with it! I can honestly say if someone had shown me the Programming Scala book by by Martin Odersky, Lex Spoon & Bill Venners back in 2003 I'd probably have never created Groovy.

In the rest of his blog post, Strachan highlights some of the reasons he thinks Scala can serve as a long-term replacement for Java. For instance:

Scala seems to hit the perfect sweet spot between the consise feel of a dynamic language, while actually being completely statically typed. So I never have to remember the magic methods that are available - or run a script in a shell then inspect the object to see what it really looks like - the IDE/compiler just knows while you edit.

Yet Scala has type inference - so its typically as concise as Ruby/Groovy but that everything has static types. This is a good thing; it makes code comprehension, navigation & documentation much simpler. Any token/method/symbol you can click on to navigate to the actual implementation code & documentation. No wacky monkey patching involved, or doubting of who added a method, when and how - which is great for large projects with lots of folks working on the same code over long periods of time...

Another advantage of Scala Strachan mentions is that Scala allows one to gradually migrate from Java-style OO programming to a hybrid functional-OO style that can be especially helpful when writing concurrent applications:

It also lets folks gradually migrate from a traiditional OO/Java way of coding to a more functional way - which is particularly relevant for folks writing concurrent or asynchronous code (which due to the GHz of chips no longer going up but instead we're getting more cores is becoming more necessary). You can start the OO way and migrate to using immutable state if/when you need its benefits. Increasingly functional programming is becoming more and more important as we try and make things more concise and higher level (e.g. closures, higher order functions, pattern matching, monads etc) as well as dealing with concurrency and asynchrony via immutable state etc.

What do you think of Strachan's stake on Scala?


Vincent O'Sullivan

Posts: 724
Nickname: vincent
Registered: Nov, 2002

Re: Groovy Creator James Strachan on Scala Posted: Jul 7, 2009 6:49 AM
Reply to this message Reply
Well, given the author, it settles my personal "Groovy or Scala" dilemma. In fact, I'd go so far as to paraphrase the author as saying that Scala's existence has rendered Groovy unneccessary.

Thomas Mueller

Posts: 18
Nickname: thomasm
Registered: Jan, 2009

Re: Groovy Creator James Strachan on Scala Posted: Jul 7, 2009 8:02 AM
Reply to this message Reply
Spring is aggressively pushing Groovy (for example at the Jazoon conference in Switzerland two weeks ago)... They will not be happy about this.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: Groovy Creator James Strachan on Scala Posted: Jul 7, 2009 9:20 AM
Reply to this message Reply
I know this is a nit and probably really unimportant but when people talk about the elegance of Scala, I think of this:

http://www.scala-lang.org/docu/files/api/scala/Tuple22.html

There's probably a good reason for this but it seems like these tuple classes could be generated as needed. If we need a Tuple22, whose to say we don't need a Tuple23, and so forth and so on.

Cameron Purdy

Posts: 186
Nickname: cpurdy
Registered: Dec, 2004

Re: Groovy Creator James Strachan on Scala Posted: Jul 7, 2009 9:41 AM
Reply to this message Reply
James,

The more one studies Scala, the more nits one may find.

Peace,

Cameron Purdy | Oracle Coherence

Nemanja Trifunovic

Posts: 172
Nickname: ntrif
Registered: Jun, 2004

Re: Groovy Creator James Strachan on Scala Posted: Jul 7, 2009 12:34 PM
Reply to this message Reply
Scala options are an example how hard it is to create a clean language *and* remain compatible with an existing platform :)

If there was no need to interoperate with Java (or JVM in general), null could be abandoned and options used instead. This way, one cannot rely on a non-option value never being null, and that really reduces the usefulness of options. I ran into the same problem with F# and its option types.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: Groovy Creator James Strachan on Scala Posted: Jul 7, 2009 12:57 PM
Reply to this message Reply
> James,
>
> The more one studies Scala, the more nits one may find.

There are many things about Scala that I would change but I think people are getting the idea that I am hostile towards Scala (which is not the case) so I'm holding back. In the past my pleas that certain features be reconsidered have been summarily dismissed so I'm slowly coming to the conclusion that Scala just isn't for me.

Carson Gross

Posts: 153
Nickname: cgross
Registered: Oct, 2006

Re: Groovy Creator James Strachan on Scala Posted: Jul 7, 2009 2:37 PM
Reply to this message Reply
> > James,
> >
> > The more one studies Scala, the more nits one may find.
>
> There are many things about Scala that I would change but
> I think people are getting the idea that I am hostile
> towards Scala (which is not the case) so I'm holding back.
> In the past my pleas that certain features be
> e reconsidered have been summarily dismissed so I'm slowly
> coming to the conclusion that Scala just isn't for me.

<smile/>

I'll be the "hostile to scala" guy for this thread.

Cheers,
Carson

Fred Garvin

Posts: 52
Nickname: fredgarvin
Registered: Jan, 2008

Re: Groovy Creator James Strachan on Scala Posted: Jul 7, 2009 2:54 PM
Reply to this message Reply
Scala has its place, but a *replacement* for Java? I don't know...

Aside from platform neutrality, the primary reasons Java became mainstream were familiarity and simplicity. Java's imperative OO foundation provided the necessary welcome mat to attract the leagues of existing C++ and VB programmers. It was relatively painless for most programmers to switch to Java.

In contrast Scala is a *functional* OO language. If the past 30+ years have anything to say about programming languages, it's that the vast majority of programmers prefer imperative ones over functional ones. Functional langauges had many opportunities to win us over, but they never did. They remain the sideshow. Why is that?

I can't speak for anyone else, but I think more in terms of the imperative OO model. I appreciate functional languages, but the best language for me is one in which I can easily express my mental model of the world. I don't think I'm alone. In my college days I recall students having significant difficulty grasping functional concepts. For instance, everyone had a rougher time with LISP than with Pascal (this was in the 80s). I don't recall anyone *choosing* LISP for projects. I don't think LISP is a bad language; it's relatively powerful and expressive. It's just not as natural to us as Pascal or Java.

The reason we switched to Java in the late 90s wasn't because it was like C++. We switched to take advantage of what Java had to offer above and beyond C++: plaform independence, it ran in browsers, servlets, garbage collection, etc. Big major huge features that we could not get from C++. Why would we switch to Scala? Why would a bottom line oriented business switch?

Eventually, I'd like to see Java evolve in the direction of C#. Feature-wise C# passed Java years ago. It's not perfect, but C# to me has the right balance: imperative OO with closures where they make sense. If Java gets there, fine. If not, well, some other language just might replace Java, but Scala? Nah.

Kay Schluehr

Posts: 302
Nickname: schluehk
Registered: Jan, 2005

Re: Groovy Creator James Strachan on Scala Posted: Jul 7, 2009 3:28 PM
Reply to this message Reply
> Eventually, I'd like to see Java evolve in the direction
> of C#. Feature-wise C# passed Java years ago.

I believe Java will go the way of Python 3 at some point in its future i.e. break with the Java 1.X series and will provide an upgrade path for old code. That's probably even simpler for Java than for Python because it doesn't depend on tons of C extensions that have to be ported as well.

Trond Olsen

Posts: 14
Nickname: tolsen
Registered: Mar, 2007

Re: Groovy Creator James Strachan on Scala Posted: Jul 7, 2009 5:30 PM
Reply to this message Reply
I don't think it'll ever replace Java, but it's nice to have some alternative languages. I personally find the Java language too restrictive, so it's nice when languages like Scala can widen the blinders a little bit more on what's possible within programming languages.

I also believe the "simple" Java syntax it given too much credit for the success of the Java platform. Just contrast library handling in Java with C++.

Carson Gross

Posts: 153
Nickname: cgross
Registered: Oct, 2006

Re: Groovy Creator James Strachan on Scala Posted: Jul 7, 2009 10:01 PM
Reply to this message Reply
> I also believe the "simple" Java syntax it given too much
> credit for the success of the Java platform. Just contrast
> library handling in Java with C++.

Java made it simpler to program that C++ did, by giving us a C-like language that had GC. GC was the killer feature at first. After that, the libraries that built up in Java ended up dominating the landscape: they are complete and usually professional, although they are often overly technical and lacking the simple-API-for-simple-problems elegance of other languages like Ruby.

This is why I don't think Scala will be the next java. The next programming language should make it *simpler* for day-to-day developers to get work done. Scala certainly addresses many of the problems with Java and has some innovative and interesting ideas in it, but I can't help but feel that, when I look at a lot of Scala code, things are *more* complicated than Java, not less.

As an example, the implicit closure parameter syntax is a cute way to address the last few flits of closure syntax that might be objected to, but it is hard to read. Underscore's are small and difficult to see and there is no place where the underscore is declared. You just have to know. Similarly, allowing arbitrary operator overloading calls into question what exactly every operator in the language does. And so on.

Scala is certainly a more powerful language than Java, but it is more complicated as well. This will make it attractive to some thought-leaders, but I think it will ultimately limit its adoption amongst a wider audience.

Cheers,
Carson

Kay Schluehr

Posts: 302
Nickname: schluehk
Registered: Jan, 2005

Re: Groovy Creator James Strachan on Scala Posted: Jul 8, 2009 2:15 AM
Reply to this message Reply
> This is why I don't think Scala will be the next java.
> The next programming language should make it *simpler*
> * for day-to-day developers to get work done.

The problem I see is that we have almost contradictory language design requirements. We want languages that aid us in organizing code in the large, that lets us verify invariants, provide declarative elements that work uniformly, simplify concurrent programming etc. and we want languages that are easy to use, can flexibly adapt to heterogeneous environments and invite for metaprogramming which is against the grain of a rich default semantics.

And what can I say? We have those languages already. They are just not unified in one kitchen sink language which attempts to be all for every purpose. On platforms like the JVM or the CLR they are even well integrated with a preference for the static model but this is going to change right now.

Each language designer might try to invent the final language which turns the whole of programming into a single intellectual province and relieve us from being polyglot. More than one programming language is an anomaly that has to be corrected.

However reality isn't going to confirm this dream that was dreamed at least since the early 80s with Ada and Common Lisp and C++ and later with Java. Now Scala shall reinforce the fantasies of the monoglot and the inevitable responses are "uh, but it's not as simple as Ruby" which is not Scalas fault but a consequence of design decisions that make sense for a different kind of tool.

Otengi Miloskov

Posts: 2
Nickname: otengim
Registered: Jul, 2009

Re: Groovy Creator James Strachan on Scala Posted: Jul 8, 2009 2:38 AM
Reply to this message Reply
The beauty of Groovy is the simplicity and in works on the JVM and interop very good with Java or what about JRuby or Jython those are simple and nice languages that run over the JVM.

What about Python or Ruby on LLVM with high performance jit, concurrent and garbage collector I think those could be better for the next thing than Scala.

Me too I think Scala is not the next thing.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: Groovy Creator James Strachan on Scala Posted: Jul 8, 2009 7:46 AM
Reply to this message Reply
> Each language designer might try to invent the final
> language which turns the whole of programming into a
> single intellectual province and relieve us from being
> polyglot. More than one programming language is an anomaly
> that has to be corrected.

I believe that it is likely the case that no such language can be created. While it's true that there is a lot of unnecessary complexity in programming languages (in general) I think there's essential complexity to any given problem. When a programming language is simple, it's easier to master but takes more code to solve a given problem. When the language is more complex, it can take less code but the tool is harder to master. I don't think it's possible to change that. I can't prove this (even informally) but I feel that there should be some way to do so.

Flat View: This topic has 69 replies on 5 pages [ 1  2  3  4  5 | » ]
Topic: Fit or Future? Which is More Important When Hiring? Previous Topic   Next Topic Topic: ScalaTest 1.6.1 for Scala 2.9.0 released


Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us