The one thing Java has and ruby doesn't.
Currently I’m writing an GUI application, I started developing on my mac using the lovely CocoaRuby framework that is truly a pleasure to use together with the nice GUI builder and the rather good incorporation with ruby.
After about a month I got the main part of my app done, the logic behind it, a custom control to add a special feature I needed to the guy loading, saving exporting, I told a costudent of mine about it. He loved the app and told me he wants a copy, first I told him I’m sorry for him but it’s a Mac only app.
After a few days it got me that it must be possible to separate GUI and program logic far enough to comparable easily switch from one GUI framework to another (in my case from CocoaRuby to Ruby/TK as from the info I found it was by default included in the windows installer and I wanted to keep things simple for the folks that are sticking with Redmond OS’s).
So it took me another week to completely separate GUI and program logic and no single line of ‘program’ was left in the gui parts of the application.
All drawing routines were moved into a custom class that encapsulated them in own ones that were supposed to be used in the code so only the drawing class itself providing simple functions hat to be redone not the whole custom class.
All logic and event-handing were moved in another class that were created upon GUI start and just the appropriate functions were called in the events of the GUI and some callbacks set up to handle responses.
After all that was done I was quite happy, I reached my first goal and it was working DAMN nice, it helped a lot to clean stuff up and refactorate a few things. So two days later I got a TK GUI done that at least handled 75% of the functionality of the original GUI and I went to try it on a Windows machine.
I was about to explode when I noticed that the latest ruby installer didn’t had the TK libs provided any more but instead the Fox GUI Framework. While it is perhaps not that a big deal to do yet another GUI for the App there was something that bothered me:
There are a load of GUI frameworks for Ruby but NONE is universal for all systems that hold ruby. Some are preinstalled on this, some on the other and some on non systems. Some work here but not there or are a pain to install at all.
* GTK+ easy to set up on linux but a pain on windows and Mac
* Tk Easy on Mac and Linux but in the newest installer for windows it needs another 20MB packet of ActiveTcl to have the needed libs.
* CocoaRuby A dream on the MAc but of cause won’t run on any other system
* Fox Is supplied with the Windows installer not with any others
I surely forgot quite some toolkits but I doubt it is much different with any others. Not to mention that non of the toolkits I tested come even close to the usual ruby feeling of ‘it just works’.
So why did I started with ‘what java has that ruby don’t’ and I must admit it is the first thing like that I find ;) it has a default GUI, one that runs on EVERY system that runs Java, without installing any extra packages, without compiling stuff, without having things working on only one system but not the other.
Ruby truly leaks such a thing, like an universal GUI that works wherever ruby works and does so on the ruby way (nicely), without that one has to screw ones mind to write ruby that look nearly like C (or worst!) without all such pain. And not to forget, one that just looks nice (honestly most GUIs especially the ones that look like windows) are just plain ugly.
So much for that, if I ever find the time I’m going to try this but I don’t think I know enough about GUIs to get this running - help is welcome!
Trackbacks
Use the following link to trackback from your own site:
http://blog.licenser.net/trackbacks?article_id=29
Comments
- Quite nice article, however on a typical linux distribution it is easy to install fox + fxruby (mind you, I am using them from source, ie. compile them from source, and use paco from sourceforge to drop binaries. Works for me) So the weak point in here is not Linux, but in fact - Windows. Because any Linux user that would complain he cant install Fox/Wxwidgets etc.. is a joke ;-) (that being said, i tell you I TOTALLY understand them IF they dont WANT to install another lib...)
- shouldn't the qt3 ruby bindings do the work ? I newer tried them.
- to she: yes Windows carries more problems then Linux so Mac carries some too. So problems like just ugly interfaces have nothing to do with any OS's. (and especially fox is in that category) And I would understand if a KDE, Fluxbox or whatnot user don't wants to install extensive libs like GTK or QT to be frank. which brings me right to the next point, to mugalle: When the research I did on QT is right, the licens is VERY restrictive which is a great problem from what I ghathered and ruled it out in the first place just cause I didn't wanted to bother with another licens and perhaps even consequences for the user in the end or something like that.
- Update: Seems like Gtk is on it's way to Mac OS X: http://www.oreillynet.com/mac/blog/2006/12/illuminous_meet_gtk_1.html Let's hope for the best :-)
- http://developer.imendio.com/projects/gtk-macosx Maybe this link works :s
- Problem is not windows only. While yes it is perhaps the most complicated of them the OS itself is only one. Mind you Ruby has a flair for the way it handles things. Fox (as example here) completely wracks over the 'ruby way' and makes it more to a C-Script from the look and feel of the code. The biggest problem I found is that there is non I particularly say I love to use. It's more like selecting the one that is not the worst and not selecting the best.
