I actually have used Tcl/Tk a lot more than Ruby. I’m actually starting to
use Ruby some more to see how I like it compared to Tcl/Tk. I can give you
my preliminary pro/con list with a few qualifiers: (1) I am not an expert
programmer, (2) I am still pretty new at Ruby, (3) I am not very
experienced, nor a huge fan of OO programming.
With those points in mind, here are IMHO some pros/cons:
Sent: Monday, August 19, 2002 10:36 AM
Subject: Ruby vs. TCL/TK?
I’ve just started playing w/ Ruby and like it quite a bit so far.
But I was wondering, I know that TCL/TK has a large following
out there. Is
anyone here a convert from TCL/TK to Ruby? If so, why? What
do you consider the
relative advantages/disadvantages of each?
Is it a fair comparison?
Can GUI apps be created with Ruby as easily as with TCL/TK?
Interested in your thoughts,
Christopher J. Meisenzahl CPS, CSTE
Senior Software Testing Consultant
- Has very mature, portable, built-in GUI library.
- Has lots of additional libraries for just about everything you could want
(smtp, database, COM, etc.) that are usally available in binary form for the
two platforms I use most (Windows and Linux).
- Has the ability to package code into a fairly small exe on Windows using
GREAT tools like Freewrap and Tclkit.
- Syntax is quirky.
- Can’t pass arrays (hash in Ruby) to functions.
- When building Guis, sometimes I feel the code gets kind of cluttered with
tons of widget commands followed by tons of pack commands. This is probably
more due to my deficiencies as a programmer than any inherent fault of
Tcl’s. One reason I am trying Ruby is to see if it’s built-in OO lets me
produce cleaner code when I am building moderately complex Guis.
- Very clean syntax that seems to be pretty intuitive.
- Built in support for lots of libraries (smtp, ole, os level, etc.). To
me, it strikes a good balance between the “kitchen sinkness” of Python and
the “minimalist model” of Lua.
- Can pass different code structures to functions and back.
- OO layer makes more sense to me than in any other language I have looked
at (remember I don’t know much about OO).
- Sometimes hard to find additional libraries that are precompiled with the
matching compiler (mingw, cygwin, etc.) of your Ruby interpreter.
- Gui libraries are not as well integrated into the language as Tcl/Tk, nor
as well documented.
- Not as easy to create a small exe on Windows of your completed app.
So those are my initial thoughts on the comparison. I am attempting to
duplicate a Gui Windows app in Ruby that I wrote in Tcl/Tk. I am using the
compiled mingw ruby that you can find at ruby-lang.org. You can find
additional libraries there like ruby-gtk and sqlite that are already
compiled for mingw. I would like to thank WATANABE Hirofumi for maintaining
these. When it comes time to distribute my app, I intend to slowly delete
files from the ruby distribution until I come up with the bare minimum of
files (hopefully not much more than a couple of mb) that I need to include
in my distribution. It’s crude and not as pretty as creating an exe, but it
Anyway, sorry for the long post.