• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Groovy vs. Ruby

 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Groovy parses the entire file and creates class out of it. I guess this does not happen in Ruby
 
author
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.

reply
    Bookmark Topic Watch Topic
  • New Topic