[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby vs. Groovy: your perspective

Diego Virasoro

4/13/2009 11:34:00 AM

Hello,
I realise this is a very hot topic... and people have strong feelings
about either language. I am not trying to trolling.

Still I've heard a bit about Groovy and it kind of seems like the Java
answer to Ruby (even the names are kind of similar). So I was
wondering if that kind of "first citizen" status will eventually make
it take over Ruby as a dynamic language (assuming that indeed that the
Groovy language offers everything Ruby does).

I checked online, but websites are either very old, or too "official".
So I wanted to ask my fellow Ruby programmers, who probably share
similar preferences to mine.

Note: I am not sending this to the Groovy list or the Java list. I
don't program in either, I program in Ruby, and what I am looking for
is not an "official" intro to Groovy, just some opinions from Ruby
users. Many things are about personal preference, not checking boxes
on a list. (for that there's wikipedia) :)

So thoughts? Does Groovy (the language) have everything to offer that
Ruby does? And the fact that it was designed to be used on the JVM
from they one gives it an advantage (I know I can keep use Ruby, but a
strong community means more libraries out there, more books, and in
general more help).

Fire away. :)

Diego Virasoro
44 Answers

Dylan Evans

4/13/2009 12:50:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

Use whatever language makes you happy (i do). There is plenty of room among
programmers to accommodate new languages and they tend to bounce idea off
each other which keeps development from getting stale, languages don't just
die because something new came out, for example you can still find
contingents of pascal programmers around. One issue with groovy is (at the
moment) shackled to JVM which has both it's pros and cons. Overall groovy
looks like an interesting language but for the moment i don't have a
compelling reason to use it.

On Mon, Apr 13, 2009 at 9:35 PM, Diego Virasoro <Diego.Virasoro@gmail.com>wrote:

> Hello,
> I realise this is a very hot topic... and people have strong feelings
> about either language. I am not trying to trolling.
>
> Still I've heard a bit about Groovy and it kind of seems like the Java
> answer to Ruby (even the names are kind of similar). So I was
> wondering if that kind of "first citizen" status will eventually make
> it take over Ruby as a dynamic language (assuming that indeed that the
> Groovy language offers everything Ruby does).
>
> I checked online, but websites are either very old, or too "official".
> So I wanted to ask my fellow Ruby programmers, who probably share
> similar preferences to mine.
>
> Note: I am not sending this to the Groovy list or the Java list. I
> don't program in either, I program in Ruby, and what I am looking for
> is not an "official" intro to Groovy, just some opinions from Ruby
> users. Many things are about personal preference, not checking boxes
> on a list. (for that there's wikipedia) :)
>
> So thoughts? Does Groovy (the language) have everything to offer that
> Ruby does? And the fact that it was designed to be used on the JVM
> from they one gives it an advantage (I know I can keep use Ruby, but a
> strong community means more libraries out there, more books, and in
> general more help).
>
> Fire away. :)
>
> Diego Virasoro
>
>


--
The UNIX system has a command, nice ... in order to be nice to the other
users. Nobody ever uses it." - Andrew S. Tanenbaum

Gregory Brown

4/13/2009 1:00:00 PM

0

On Mon, Apr 13, 2009 at 7:35 AM, Diego Virasoro
<Diego.Virasoro@gmail.com> wrote:
> Hello,
> I realise this is a very hot topic... and people have strong feelings
> about either language. I am not trying to trolling.
>
> Still I've heard a bit about Groovy and it kind of seems like the Java
> answer to Ruby (even the names are kind of similar). So I was
> wondering if that kind of "first citizen" status will eventually make
> it take over Ruby as a dynamic language (assuming that indeed that the
> Groovy language offers everything Ruby does).

I am not really familiar with Groovy, but I'm somewhat surprised you
didn't mention JRuby here.
It runs on the JVM, lets you access the wealth of the Java libraries,
and is fully compatible with Ruby 1.8.6.
It is also targeting Ruby 1.9 features over time.

So I'm not sure why I'd use something "like Ruby" if I could just use Ruby.

-greg

Diego Virasoro

4/13/2009 2:01:00 PM

0

> Use whatever language makes you happy (i do).

Well, that was the plan. And currently Ruby seems more elegant. But is
this true? And is it more powerful? And it's easier to use? I dunno. I
guess I could pick a book and start reading it. But currently I don't
have much interest in learning Groovy if in the end it ends up exactly
like Ruby.

So I was hoping someone who has tried both could tell me a little bit
more on their opinion.

Diego Virasoro

4/13/2009 2:19:00 PM

0

> I am not really familiar with Groovy, but I'm somewhat surprised you
> didn't mention JRuby here.

You are right... and I think I've not explained myself very well. I
was interested to hear people's opinion about Groovy to get an idea if
I may want to invest some time in learning it or not.

To this end, I currently have two main concerns:
1- A language I enjoy using. Ruby is such a language so far (apart
from the speed). On the other hand is Groovy? Are the two really on
feature parity? What are their advantages over each other? I could
find very little recent stuff on Groovy, and as you put it << I'm not
sure why I'd use something "like Ruby" if I could just use Ruby >>. So
what is the feeling of the Rubyist that have already looked closely at
Groovy?

2- A language that will be around for a (relatively) long time, and
with a strong community support. I mean, I know Ruby per se would not
disappear if people stopped using it, but still, with little support
there are less libraries, and the technological world is a moving
target, so a language with no development would slowly become less and
less useful.

So I am sorry I confused everybody by mixing the two points. I was
trying to address both points in the opening post, but I didn't
distinguished the two questions very well. I hope things are more
clear now. :)

Diego

James Gray

4/13/2009 2:43:00 PM

0

On Apr 13, 2009, at 9:05 AM, Diego.Virasoro@gmail.com wrote:

> And currently Ruby seems more elegant. But is this true?

This is pretty much personal opinion. Which ever one feels better to
you is better.

> And is it more powerful?

There's no such thing. Both languages are Turing Complete (http://en.wikipedia.org/wiki/Turin...
). Thus, they are literally capable of the same things.

> And it's easier to use?

Again, that's pretty much personal preference. What's easy for me may
not be easy for you.

James Edward Gray II

James Gray

4/13/2009 2:53:00 PM

0

On Apr 13, 2009, at 9:20 AM, Diego.Virasoro@gmail.com wrote:

> I was interested to hear people's opinion about Groovy to get an
> idea if
> I may want to invest some time in learning it or not.

Well, learning new languages is a good thing. I've enjoyed most of
what I've worked with, even if they didn't replace Ruby for me.

> 1- A language I enjoy using. Ruby is such a language so far (apart
> from the speed).

I've been pretty impressed with 1.9's speed. Time to make the switch!

> 2- A language that will be around for a (relatively) long time, and
> with a strong community support.

While some languages do die, I think it's a pretty rare thing. Most
languages are still around in some form and generally have a community
supporting them.

James Edward Gray II


Robert Dober

4/13/2009 6:34:00 PM

0

On Mon, Apr 13, 2009 at 4:43 PM, James Gray <james@grayproductions.net> wro=
te:
> On Apr 13, 2009, at 9:05 AM, Diego.Virasoro@gmail.com wrote:
>
>> And currently Ruby seems more elegant. But is this true?
>
> This is pretty much personal opinion. =A0Which ever one feels better to y=
ou is
> better.
>
>> And is it more powerful?
>
> There's no such thing. =A0Both languages are Turing Complete
> (http://en.wikipedia.org/wiki/Turin...). =A0Thus, they are literal=
ly
> capable of the same things.
Of course, but I would like to give a broader interpretation to "performanc=
e".
There are (at least) two interpretations of "powerful" that make a
difference here.

The first is "how fast I can achieve my goal", and I believe Ruby is
difficult to beat in this domain.
This only might not be true in the case of the need of some very
specific java libraries to be reused. Groovy might have an adavantage
here, which otoh you might be able to overcome with JRuby :). (1)

If, and it is a big IF, you mean execution speed with powerful, Groovy
is probably faster, but yet there is JRuby and unless heading into the
direction of some very specific code, worrying about speed now is a
bad decision.

Really I did not like Groovy but that is why I am on this list :).
Check it out by all means if you are not happy with Ruby, but its is
quite clear, that on this list most folks will concur with your first
impressions ;).

(1) Avoid continuations
>
>> And it's easier to use?
Actually maybe not, Ruby has some subtleties which Groovy might not
have, but to learn them is very rewarding and relatively easy because
of excellent material available (c.f. Pickaxe book
http://www.pragprog.com/titles/ruby3/programmin... of which
you find an older version for Ruby1.8 online which I would recommend
by all means ) and also thanks to some very helpful folks on this
list.

HTH
Robert

--=20
Si tu veux construire un bateau ...
Ne rassemble pas des hommes pour aller chercher du bois, pr=E9parer des
outils, r=E9partir les t=E2ches, all=E9ger le travail=85 mais enseigne aux
gens la nostalgie de l=92infini de la mer.

If you want to build a ship, don=92t herd people together to collect
wood and don=92t assign them tasks and work, but rather teach them to
long for the endless immensity of the sea.

--
Antoine de Saint-Exup=E9ry

Tony Arcieri

4/13/2009 6:51:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

On Mon, Apr 13, 2009 at 5:35 AM, Diego Virasoro <Diego.Virasoro@gmail.com>wrote:

> Still I've heard a bit about Groovy and it kind of seems like the Java
> answer to Ruby (even the names are kind of similar). So I was
> wondering if that kind of "first citizen" status will eventually make
> it take over Ruby as a dynamic language (assuming that indeed that the
> Groovy language offers everything Ruby does).
>

One of the most powerful Ruby idioms I know of requires features Groovy
doesn't have. I'm talking about creating a small declarative "DSL" you call
from a class body to metaprogram methods, such as with ActiveRecord
associations, e.g.:

class Foo < ActiveRecord::Base
has_many :bars
has_many :bazzes, :through => :quuxes, :order => "created_at DESC"
end

This allows for instances of Foo to potentially respond to many different
methods based on the association names (e.g. you can call afoo.bars to get a
collection of associated bars)

Groovy does not allow code in class bodies (at least last I checked), and I
believe Grails tries to work around this with static properties, which can't
provide the full expressive power of a DSL.

I've heard generally bad things about Groovy's approach to metaclasses and
metaprogramming in general, but as I haven't used Groovy I can't really
comment in that regard.

--
Tony Arcieri

Eleanor McHugh

4/13/2009 6:59:00 PM

0

On 13 Apr 2009, at 12:35, Diego Virasoro wrote:
> So thoughts? Does Groovy (the language) have everything to offer that
> Ruby does? And the fact that it was designed to be used on the JVM
> from they one gives it an advantage (I know I can keep use Ruby, but a
> strong community means more libraries out there, more books, and in
> general more help).

I followed Groovy development for a while (between 2004-2006) and
liked what I saw, but ultimately gave up on developing for the JVM and
lost interest. Were it to break out of that particular ghetto I think
it could gain in popularity, although from what I recall it's similar
enough to Ruby in many respects that it might be difficult to
differentiate itself.


Ellie

Eleanor McHugh
Games With Brains
http://slides.games-with-...
----
raise ArgumentError unless @reality.responds_to? :reason



Martin DeMello

4/13/2009 7:58:00 PM

0

On Tue, Apr 14, 2009 at 12:29 AM, Eleanor McHugh
<eleanor@games-with-brains.com> wrote:
>
> I followed Groovy development for a while (between 2004-2006) and liked what
> I saw, but ultimately gave up on developing for the JVM and lost interest.
> Were it to break out of that particular ghetto I think it could gain in
> popularity, although from what I recall it's similar enough to Ruby in many
> respects that it might be difficult to differentiate itself.

Clojure pushes the jvm as a strength [http://clojure.org...].
It's certainly nice to have all those libraries for free and a
well-optimised vm, though I got a trifle disillusioned when I wrote an
app in it and discovered that yes, swing does suck. (Some day I'll
work up the energy to scrap the UI and rewrite it in QtJambi)

martin