[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Pros and Cons of Ruby vs JRuby for GUI

Victor Reyes

3/25/2008 1:21:00 PM

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

Although I have been using Ruby for awhile, I am really a beginner as I use
it very sporadically and depend much on my books and the forum.
In the recent past, while trying to learn a GUI tool, I tried writing simple
GUI appls using ruby-gnome2, WxRuby, QtRuby, FXRuby, Tk and WideStudio. Only
the last one gives you dragANDdrop capabilities, although the widgets looks
and feel are not appealing. Then I heard that *JRuby* has built-in GUI
support via *swing*. To confuse me even more (and believe me it does not
take much for that), now I heard about a tool named *clutter* which is
supposedly very nice.
I am actually looking for *quick* and *easy *way to create a GUI appl.

My questions are:

What are the pros and cons of *Ruby* vs *JRuby*?
How far behind "regular" *Ruby* *JRuby* is?
Since *Ruby* is written in *C* and *JRuby* in *Java* isn't *Ruby* faster
than *JRuby*?
Other than *swing* in *JRuby* is there any advantage of using *JRuby*
over *Ruby?
*I guess this is related to question 1.

Thank you

Victor

14 Answers

Robert Dober

3/25/2008 2:26:00 PM

0

On Tue, Mar 25, 2008 at 2:20 PM, Victor Reyes <victor.reyes@gmail.com> wrot=
e:
> Although I have been using Ruby for awhile, I am really a beginner as I u=
se
> it very sporadically and depend much on my books and the forum.
> In the recent past, while trying to learn a GUI tool, I tried writing si=
mple
> GUI appls using ruby-gnome2, WxRuby, QtRuby, FXRuby, Tk and WideStudio. =
Only
> the last one gives you dragANDdrop capabilities, although the widgets lo=
oks
> and feel are not appealing. Then I heard that *JRuby* has built-in GUI
> support via *swing*. To confuse me even more (and believe me it does not
> take much for that), now I heard about a tool named *clutter* which is
> supposedly very nice.
> I am actually looking for *quick* and *easy *way to create a GUI appl.
>
> My questions are:
>
I am sure you will get much more prominent answers but here are some
first thoughts
> What are the pros and cons of *Ruby* vs *JRuby*?
> How far behind "regular" *Ruby* *JRuby* is?
Not behind at all, with the exceptions of continuations IIRC.
> Since *Ruby* is written in *C* and *JRuby* in *Java* isn't *Ruby* faster
> than *JRuby*?
Not necessarily, the C implementation is a na=EFve interpretation of the
AST, while Java byte code is highly optimized.
Ruby's dynamic nature takes many of these optimizations away, but
Charles has made incredible effort for speed.
They are about the same right now, but be aware that C-Ruby will not
get much faster while JRuby might still get some very large speedup.
Right Charles?
> Other than *swing* in *JRuby* is there any advantage of using *JRuby*
> over *Ruby?
Swing is all but an advantage, unless you have a really cool tool to
generate a Swing interface, it is APITN to write swing GUIS.
But very often JRuby is considered the backdoor entrance of Ruby into
a company that disallows the red gem the main entrance. If this does
not apply to you other advantages depend very much on your needs, GUIs
are known AFAIK.

My tiebreaker would be the knowledge and love you have for Java.

> *I guess this is related to question 1.
>
Waiting myself for what the Gurus have to say ;)
Cheers
Robert



--=20
http://ruby-smalltalk.blo...

---
Whereof one cannot speak, thereof one must be silent.
Ludwig Wittgenstein

Robert Dober

3/25/2008 2:27:00 PM

0

Sorry I made a very bad, because confusing error
> not apply to you other advantages depend very much on your needs, GUIs
> are known AFAIK.
... GUIs are *none* AFAIK

Christopher Dicely

3/25/2008 2:41:00 PM

0

On Tue, Mar 25, 2008 at 6:20 AM, Victor Reyes <victor.reyes@gmail.com> wrote:
> Although I have been using Ruby for awhile, I am really a beginner as I use
> it very sporadically and depend much on my books and the forum.
> In the recent past, while trying to learn a GUI tool, I tried writing simple
> GUI appls using ruby-gnome2, WxRuby, QtRuby, FXRuby, Tk and WideStudio. Only
> the last one gives you dragANDdrop capabilities, although the widgets looks
> and feel are not appealing.

While I've never used the functionality (yet), and have only just
started using FXRuby, but the FOX Toolkit and FXRuby support drag and
drop. See:
http://www.fxruby.org/doc/dragdr...
http://www.fox-toolkit.com/dragan...

> Then I heard that *JRuby* has built-in GUI
> support via *swing*. To confuse me even more (and believe me it does not
> take much for that), now I heard about a tool named *clutter* which is
> supposedly very nice.
> I am actually looking for *quick* and *easy *way to create a GUI appl.

For *quick* and *easy*, I'd suggest Shoes
(http://code.whytheluckystiff....), but it doesn't support
drag-and-drop that I know of.

FOX seems pretty quick and easy as GUI toolkits go, and relatively
full featured. Swing certainly is familiar if you are used to Java GUI
development, and has plenty of visual UI design tools available, so it
might be the easiest (but someone whose spent more time using it from
Ruby than I have can say more.)

>
> My questions are:
>
> What are the pros and cons of *Ruby* vs *JRuby*?
> How far behind "regular" *Ruby* *JRuby* is?
> Since *Ruby* is written in *C* and *JRuby* in *Java* isn't *Ruby* faster
> than *JRuby*?

JRuby is, mostly, faster than and compatible with Ruby 1.8. The JRuby
team has taken the stance that anything where it is slower than the
main interpreter is a "bug".

> Other than *swing* in *JRuby* is there any advantage of using *JRuby*
> over *Ruby?

Other than Swing and speed (but related to Swing) is the ability to
leverage other Java libraries.

James Britt

3/25/2008 3:11:00 PM

0

Robert Dober wrote:

>> Other than *swing* in *JRuby* is there any advantage of using *JRuby*
>> over *Ruby?
> Swing is all but an advantage, unless you have a really cool tool to
> generate a Swing interface, it is APITN to write swing GUIS.


Use Netbeans to draw the UI

Use Monkeybars to wire it up in pure, intuitive Ruby.

It doesn't get any easier.

Seriously; if you think Rails makes it easy to do Web apps, Monkeybars
gives the same creamy Ruby goodness to Swing apps.


--
James Britt

www.rubyaz.org - Hacking in the Desert
www.risingtidesoftware.com - Wicked Cool Coding
www.jamesbritt.com - Playing with Better Toys

ThoML

3/25/2008 3:16:00 PM

0

> I am actually looking for *quick* and *easy *way to create a GUI appl.

I don't know how/if/to what extent/how fast jruby is/will be adapting
ruby1.9 features. If java + swing + ruby18 is okay for you, I would
rather use jruby. There are a few libraries around that make the use
of swing easier. Just yesterday ... E.g. http://monkeybars.rub...
(I haven't used it myself yet though so I don't know if it's any
good.) IIRC there are more libraries like this around too.

Stefano Crocco

3/25/2008 3:22:00 PM

0

On Tuesday 25 March 2008, Christopher Dicely wrote:
> > =A0Although I have been using Ruby for awhile, I am really a beginner a=
s I
> > use it very sporadically and depend much on my books and the forum. In
> > the recent past, while trying to learn a GUI tool, I tried writing simp=
le
> > GUI appls using ruby-gnome2, WxRuby, QtRuby, FXRuby, Tk and WideStudio.
> > Only the last one gives you dragANDdrop capabilities, although the
> > widgets looks and feel are not appealing.
>
> While I've never used the functionality (yet), and have only just
> started using FXRuby, but the FOX Toolkit and FXRuby support drag and
> drop.
>=20
And so do qtruby and wxruby.

Stefano



znmeb

3/25/2008 11:55:00 PM

0

On Mar 25, 7:41 am, Christopher Dicely <cmdic...@gmail.com> wrote:
> For *quick* and *easy*, I'd suggest Shoes
> (http://code.whytheluckystiff....), but it doesn't support
> drag-and-drop that I know of.

Shoes is cross-platform and rather appealing visually. It may support
drag and drop.

One other *really* *really* *really* cool toolkit I discovered
recently is called JUCE. Talk about drag and drop -- you can drag
stuff out of a widget onto your desktop! It also has audio and 3D
interfaces. GSoC mentors, how about Ruby bindings??? ;) ;)

http://www.rawmaterialsoftware...

Charles Oliver Nutter

3/26/2008 1:29:00 AM

0

Robert Dober wrote:
>> What are the pros and cons of *Ruby* vs *JRuby*?
>> How far behind "regular" *Ruby* *JRuby* is?
> Not behind at all, with the exceptions of continuations IIRC.

Correct, though currently there's a bit of tail-chasing to get JRuby the
last 1% of compatibility outside continuations since even in 1.8
patchlevels minor things occasionally change. But in general, we
consider compatibility to be largely a done deal.

>> Since *Ruby* is written in *C* and *JRuby* in *Java* isn't *Ruby* faster
>> than *JRuby*?
> Not necessarily, the C implementation is a naïve interpretation of the
> AST, while Java byte code is highly optimized.
> Ruby's dynamic nature takes many of these optimizations away, but
> Charles has made incredible effort for speed.
> They are about the same right now, but be aware that C-Ruby will not
> get much faster while JRuby might still get some very large speedup.
> Right Charles?

I can't really speak for C Ruby, but JRuby certainly has a *lot* of open
road ahead for optimization. We've only stopped actively working on
performance lately because it's already looking great, and we wanted to
stabilize the 1.1 release and start planning for better integration with
Java classes and Ruby 1.9 features.

>> Other than *swing* in *JRuby* is there any advantage of using *JRuby*
>> over *Ruby?
> Swing is all but an advantage, unless you have a really cool tool to
> generate a Swing interface, it is APITN to write swing GUIS.
> But very often JRuby is considered the backdoor entrance of Ruby into
> a company that disallows the red gem the main entrance. If this does
> not apply to you other advantages depend very much on your needs, GUIs
> are known AFAIK.

James Britt is right about MonkeyBars, it's a great way to leverage
Swing without writing GUIs by hand. By and large I think hand-built GUIs
of nontrivial size simply don't scale, so the MonkeyBars approach is the
right way to go. And the Matisse Swing GUI editor in NetBeans is
*excellent*.

- Charlie

Charles Oliver Nutter

3/26/2008 1:31:00 AM

0

ThoML wrote:
>> I am actually looking for *quick* and *easy *way to create a GUI appl.
>
> I don't know how/if/to what extent/how fast jruby is/will be adapting
> ruby1.9 features. If java + swing + ruby18 is okay for you, I would
> rather use jruby. There are a few libraries around that make the use
> of swing easier. Just yesterday ... E.g. http://monkeybars.rub...
> (I haven't used it myself yet though so I don't know if it's any
> good.) IIRC there are more libraries like this around too.

re 1.9 features: How fast is an open question, but we're pushing out
JRuby 1.1 final very soon, and other than maintenance releases our two
big goals for the next major JRuby are 1.9 feature support and
completely rewritten Java integration. I suspect the 1.9 features will
be easy.

- Charlie

Marc Heiler

3/26/2008 1:36:00 AM

0

> Only the last one gives you dragANDdrop capabilities, although the widgets
> looks and feel are not appealing.

You can drag and drop with Ruby-gtk too, it's maybe not as
straight-forward as possible and you'd have to dig up a bit in the docs,
but its definitely doable and works.
--
Posted via http://www.ruby-....