views:

197

answers:

2

For Web Applications I use Ruby on Rails. And now it's time to see if I can code Desktop Applications with Ruby.

So I wonder which one I should choose.

The way I see it is MacRuby+IronRuby vs JRuby.

The former lets me have desktop applications for both Mac and Windows while the latter lets be have in both, but only learning one tool.

  • Is there strong arguments to use the former than the latter?

  • Will JRuby Desktop Applications be as native (or near-enough-native) as MacRuby+IronRuby Desktop Applications?

  • What are the pros and cons for each solution?

Im very new too Desktop development. Share your thoughts and experience!

+1  A: 

MacRuby uses the native Apple Objective C stack.
Pros: Its class library is basically a wrapper for the Objective C GUI classes. You get fast native applications.
Cons: Only runs on Macs. They are not portable to the iPad or iPhone either (none of the Ruby solutions are).

IronRuby uses the native Windows .NET framework.
Pros: Use native WinForms to create rich native applications. It has access to the full .NET ecosystem of libraries.
Cons: Only runs on Windows.

JRuby uses the Java abstraction layer (JVM).
Pros: Multiple GUI libraries available. The most common ones are SWT and Swing. SWT uses native widgets and is faster and more native like. Swing is purely Java (emulated widgets) and is more portable. There are further libraries abstracting SWT and Swing to make them more Ruby friendly. Look at Profligacy for Swing for instance.
Cons: A layer above a layer above a layer. Swing and SWT are very mature but the Ruby layers above them are less so.

There is also another option
Ruby with the Qt library.
Qt is cross platform, uses native widgets and is written in C++. It is fairly fast but the library is complex and big.

My rule of thumb is the more complex your GUI is, the closer you should be to the native platform. You need to also evaluate the learning curve for each of these graphical libraries and the effort needed to port between platforms.

Alkaline
It's not true that IronRuby runs only on Windows. It runs everywhere where an ISO-compliant CLI implementation is available, which is practically everywhere. Heck, there's even a CLI implementation for the iPhone! In fact, if I remember correctly, there was a Debian package for IronRuby *before* there was a Windows installer for it. Also, YARV runs on the iPhone. Oh, and you forgot a rather important difference: YARV, MRI, Rubinius, IronRuby and JRuby are released, production-ready and standards-compliant, MacRuby is none of those things AFAICT.
Jörg W Mittag
@Jörg W Mittag: I tried to steer clear of esoteric solutions in my answer because they introduce extra layers and restrictions. For instance, IronRuby outside of Windows needs something like Mono to interpret the CLI code. On the iPhone, the equivalent MonoTouch actually compiles to native code, not CLI, and you can't use the .NET GUI with it. As for YARV on iPhone, I couldn't find a reference to this. Apple has been pretty strict about not allowing intermediate layers like Silverlight, Flash, JVM on the iPhone/iPad.
Alkaline
+1  A: 

IronRuby just lots its main developer, so you may want to consider that one carefully. http://wiki.github.com/rdp/ruby_tutorials_core/ruby-gui-toolkit-comparison might help

rogerdpack