File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Languages and the fly likes Implications.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Languages » Other Languages
Bookmark "Implications...." Watch "Implications...." New topic
Author

Implications....

Sanjeev BhimaRao
Ranch Hand

Joined: Jul 17, 2006
Posts: 71
Can you please tell us, what the new Groovy programming language brings to the table - that is not present in Java?

Also, Sun is getting better and better with its SDK's with every release and the whole bunch of technologies which come bundled with it. How easy is it to replace Groovy in all these places?

What about the support for any issues? Sun has a dev forum where I expect to see results to my question in 24 hours (it has happened most of the time)

And finally, is Groovy compiler based or interpreter based?
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 467
Hello Sanjeev,

Well, groovy does get some stuff that are not present in java, like dynamic typing, closures and operator overloading. Also, like a lot of scripting languages, you write much less code to produce the same output, which increases productivity and maintainability.

Now, regarding Sun and the SDK, groovy IS a part of the java language specifications. Groovy is JSR 241. Groovy is not meant to replace java, but to add new features to it. If java started supporting dynamic typing and operator overloading, and change the syntax so that we can write less code, it wouldn't be java. Instead, by supporting scripting inside java, this enhances it a lot.

As for support, I don't know how active they are, but there are mailing lists, a wiki and several forums out there.


Visit my blog: http://jnassef.blogspot.com/
S Davis
Author
Ranch Hand

Joined: Feb 07, 2006
Posts: 40
Wow -- four questions, one post. Let's dig in:

Can you please tell us, what the new Groovy programming language brings to the table - that is not present in Java?


Groovy is a dynamic language, whereas Java is statically typed. It offers strong support for things like metaprogramming, writing DSLs, closures, and the like.

But the most important thing it brings to the table is seamless interop with Java. Java can call Groovy, Groovy can call Java, and so on. It is a language that you can mix in to your existing code base rather than having to rewrite it from the ground up.

Also, Sun is getting better and better with its SDK's with every release and the whole bunch of technologies which come bundled with it. How easy is it to replace Groovy in all these places?


Hmmm, not sure that I understand the question. Java5 offers a new for/each loop. Groovy offers a list.each{} closure. Both dramatically simplify the old-school for(Iterator i = list.iterator(); i.hasNext()) way of looping you had to do in Java 1.4, but I don't consider the Java5 feature a replacement for the Groovy each closure.

With Generics, Java is moving even more towards a statically typed paradigm. With duck-typing, Groovy is moving in the opposite direction. But if you don't like those feature of Groovy, you don't have to use 'em. Groovy can be every bit as strongly typed as Java if that's your bag.

I agree that the JDK is getting better with each release. I see Java becoming two things -- a language and a platform. The platform is becoming increasingly attractive to other languages -- JRuby, Jython, Scala, and of course Groovy, just to mention a few. Java "the language" isn't going away any time soon, but I see it becoming more a part of the "plumbing" (like assembly language) and less attractive as you move up the stack.

But the most important thing is -- and I can not stress this enough -- with Groovy, it's not an either/or proposition. Java and Groovy are much stronger when used together. Groovy doesn't replace, it augments Java.

What about the support for any issues? Sun has a dev forum where I expect to see results to my question in 24 hours (it has happened most of the time)


The Groovy and Grails mailing lists are the two most active at Codehaus. See MarkMail for details. Your questions will get answered promptly.

And finally, is Groovy compiler based or interpreter based?


Groovy runs on the JVM, so it is every bit as compiled as Java, or every bit as interpreted as Java -- it all depends on your point of view. Just as you type "javac" to compile Java, you type "groovyc" to compile Groovy. As an added benefit, you can write Groovy scripts and run them without explicitly compiling them first, but rest assured that they are getting compiled into valid bytecode on the fly. To prove this, "groovyc" a simple Groovy class and then run "javap" against it -- you'll see good old "public static void main(String[] args)"...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Implications....