Thursday, September 14, 2006

perl/Tk vs wxperl vs Tkx/Tcl::Tk

This post ported from a test blog called 'nodding off' that I deleted. The timestamp is from the original post.

I wanted to explore the differences between Perlls main(only?!) gui toolkits.

The first is perl/Tk. This was a port of the Tk libraries from Tcl/Tk to perl. It works fairly well, but hasn't been updated in some time (over two years ago, I believe). The effort to port over the code was apparently too great to deal with. I like this version myself, and I have to most experience with it, but I'm going to have to drop it due to lack of support. Which leads me to....

wxPerl. This is an up to date(ppm module dated late last year, source releases from last month available at CPAN) toolkit using the wxWidgets libraries. It seems to work smoothly and quickly(at least the demo/samples do) and looks attractive. However, the code is not that friendly. It looks as if this wrapper is too light, without any simplifications. I can imagine that the code is only slightly shorter than it would be if written in C. Even worse, the drawing/cavas modules are very raw. To move items I will have to code every event and redraw. I'm not saying I couldn't do it, I'm saying I'm far to lazy to unless there aren't any other options.

Which leads us to Tkx/Tcl::Tk. These appear to be cousins of a sort, with Tkx being the Activestate product. I have been unable to mess with this thoroughly, but I was initially turned off by it because you have to install a full Tcl/Tk installation alongside your perl one. Which makes me wonder, why don't I just learn Tcl/Tk and be done with it? Or, why don't I just give up Perl altogether and go with ruby(/tk)? Well, unfortunately I can't switch languages at work, and I really don't want to have to deal with two different languages. So, I'm guessing that I'll go with Tkx for now. I've read that the new Activestates(818+) will contain a *special* tcl-tk dll that will enable this functionality without loading tcl-tk. Here's hoping that it's true and easy to use.

Labels: , ,