aspose file tools*
The moose likes Groovy and the fly likes Groovy vs. Ruby Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Groovy vs. Ruby" Watch "Groovy vs. Ruby" New topic
Author

Groovy vs. Ruby

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5843
    
    7

How much was Groovy influenced by Ruby? Are there problems that are more easily solved in Groovy than Ruby, or the other way around? Other than the fact the the JVM provides a much better runtime, what are the advantages of using Groovy over using Ruby?


JBoss In Action
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

For me the greatest advantage between the two is that in Groovy I get to use syntax familiar to Java-land. I think it's easier to jump between Groovy and Java code without too much of a brain shift.

Ruby can run on the JVM too, by the way - JRuby.


A good workman is known by his tools.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Groovy parses the entire file and creates class out of it. I guess this does not happen in Ruby


Groovy
Dierk König
author
Ranch Hand

Joined: Nov 01, 2006
Posts: 43
Originally posted by Peter Johnson:
How much was Groovy influenced by Ruby?
Groovy was influenced by a number of languages. I see that following order (most influence first) :
* Java, because that is what we rely on and integrate with
* Python
* Ruby
* Perl (especially when it comes to what we try to avoid)
* Lisp
* all the other languages that the devs have ever worked with

Are there problems that are more easily solved in Groovy than Ruby...
Everything that requires tight Java integration, like using Java frameworks that rely on annotations or generics, writing an EJB, extending abstract classes that may have overloaded methods, cross-language refactorings, and so on...

...or the other way around?
When outside the Java platform, Ruby can start up faster which makes it better suited for writing quick-starting scripts like textmate bundles. With Groovy, you typically have a startup-delay of one second or so because of the JVM.

Other than the fact the the JVM provides a much better runtime, what are the advantages of using Groovy over using Ruby?
* leveraging existing Java knowledge (if any)
* using existing Java frameworks and components
* seamless mix&match of Java and Groovy implementations
I guess you see the pattern ;-)
If Java is of any value for you, then is Groovy. If you work in a total non-Java shop, then Groovy provides no benefit for you and you may take Ruby, C#, or whatever else.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Groovy vs. Ruby