10

Is Ruby a good option for writing (possibly and partially) platform independent desktop applications?

Is there any supported libraries to write code for windows,Linux, Mac Operating systems

I know Java have capabilities to write desktop applications, what about Ruby?

Duke
  • 35,420
  • 13
  • 53
  • 70
  • I would not consider C# a good option if platform-independence is your goal. Although there are .net-implementations for other platforms than Windows, they are neither complete, up to date nor officially supported. – jupp0r Feb 21 '12 at 12:22
  • @jupp0r You are right, I've modified question. – Duke Feb 21 '12 at 12:32
  • You must note that the runnable code is visible text-plain, even if you use [RubyScript2Exe](http://www.erikveen.dds.nl/rubyscript2exe/); so it will fit opensource projects. – Sony Santos Feb 21 '12 at 12:38
  • This is half "am I insane?" and "what multi-platform GUI libs can I use?"; for the second half, http://stackoverflow.com/questions/115501/is-ruby-any-good-for-gui-development – Julian Fondren Feb 21 '12 at 12:46

7 Answers7

6

Ruby is a great language, but support for building graphical desktop applications is a bit weak. I would probably use JRuby + your Java GUI library of choice.

I believe JRuby can be pre-compiled to Java bytecode, which might also be a little bit better for closed-source applications than plain-text Ruby. (Although Java bytecode can easily be reverse-compiled.)

Alex D
  • 29,755
  • 7
  • 80
  • 126
  • TideSDK looks very promising when it comes to GUI. It uses web-tech to do native apps. Supports Ruby, Javascript, Python and PHP. http://www.tidesdk.org/ – Automatico Jan 28 '14 at 21:24
  • @Cort3z, thanks for sharing that information, but that is not a "comment" on my answer. That information belongs in a new answer, not a comment. – Alex D Jan 29 '14 at 06:19
  • Yeah. I realised, so I [made one](http://stackoverflow.com/a/21417309/741850) right after :) – Automatico Jan 29 '14 at 11:41
4

The problem with multi-platform GUI libraries is that they look ugly in any platform.

As a OSX user if I see a Java or X interface I automatically and mentally assign 10 less points to the quality of this application, even if it doesn't deserve it.

There is only one multi-platform GUI library that doesn't trigger any of my mental prejudices: HTML5. But of course you can not access to the native OS API.

I would recommend to try to define the architecture of your application is such a way that the 90% of the code is visualization agnostic. And then build this 10% of visualization layer for any platform adhoc.

If you are not worry about the professional perception of your app I can say that any of the propositions that have been done are a good choose.

fguillen
  • 36,125
  • 23
  • 149
  • 210
2

I'd suggest you to take a look at Shoes. Whether its a good option or not is a debate that depends on your constraints and preferences. If you are more comfortable with programming in Ruby as opposed to Java or C# then I'd definitely consider it to be a good option.

Aziz
  • 534
  • 5
  • 23
2

It depends on what kind of app you are developping. I would not say ruby is that cross plateforme for apps that need a complex gui for instance. Python seems a little bit more X-platform from my experience ,Java is definetly. And why not try C++ and Qt ?

http://qt.nokia.com/products/

Edit : since the question was edited , i would add go either with Java or Qt more than Ruby.

mpm
  • 20,148
  • 7
  • 50
  • 55
1

You could try FXRuby, it's based on the FOX Toolkit library and allows for cross-platform Ruby GUI development. Even more exotic platforms like FreeBSD are supported. You can package your Application together with a Ruby interpreter and all required frameworks to minimize target platform dependencies.

jupp0r
  • 4,502
  • 1
  • 27
  • 34
1

IMHO Ruby is a great choice for cross-platform GUIs. However, it depends on what GUI toolkit you use. The tools are: Qt, Tk, wxRuby, Shoes, GTK etc. I chose GTK because you can use the Glade interface designer to build your forms. You can see several examples of GUIs build with ruby at:

http://www.visualruby.net

About the programs' appearance, I've tried my programs on Ubuntu, Win7 and Win XP, and everything looks perfect. Also, if you look at Tks website, they have screenshots of TK GUIs in various platforms, and they look fantastic too.

The major benefit to writing GUIs in ruby, is that you get to use ruby instead of java. Personally, I find ruby a joy to work with. Good Luck.

user1182000
  • 1,625
  • 14
  • 12
0

I believe it can be with TideSDK. I recently discovered this and it seems to the one of the best approaches for multi-platform gui I have seen. It does use HTML5, but it has support for things like system tray and other native behavior.

I have looked into a bunch of the other alleged cross-platform solutions, but I don't find them appealing.

One note about TideSDK today: It only supports Ruby 1.8.7. This is actually a big issue for me as many of the gems I want to use is 1.9.2+. The TideSDK deployed on linux is 1.9, but not osx or windows, they are on 1.8.7. This is something they hopefully will update soon. Would love to see multiple ruby versions.

Anyways. Have a look at it. It is open source also, aka. free, so that is nice.

Automatico
  • 12,420
  • 9
  • 82
  • 110