Book reviewUSENIX

 

Mark Harrison
Tcl/Tk Tools
O'Reilly & Associates 1997. ISBN 1-56592-218-2. Pp. 678. $49.95.

Reviewed by Clifton Flynt
<clif@cflynt.com>

One of the best things about the Tcl/Tk language is the large number of packages that have been developed around it. Some of these extensions have used Tcl as a base language for creating special-purpose tools; others have extended the Tcl language with new general-purpose commands.

Learning how to use the packages hasn't always been easy, though. Most of them include a set of man pages, but unfortunately, man pages aren't always sufficient. Tutorial material and examples have been sparse.

Tcl/Tk Tools steps into that gap and fills it well. Most of this book consists of tutorial and overview chapters on several of the more popular Tcl/Tk extensions. There is also a chapter of techniques for debugging Tcl scripts, instructions for merging multiple packages into a customized shell, and instructions on configuring X window system security using xauth.

The CD-ROM included with the book has binaries for Solaris and Linux, and source code for the packages discussed in the book. The code distributed on the CD-ROM is Tcl 7.6 based, not Tcl 8.0, but having the proper revisions of the sources in one place makes compiling the packages a painless task. The other disappointment is that the CD-ROM doesn't include the examples.

This is not a book for the Tcl/Tk novice. It is not a Tcl/Tk tutorial. It assumes that you already speak Tcl/Tk and need to learn how to work with an extension package.

The book covers several types of extensions: general programming, GUI, and specific application extensions. This breadth of coverage makes it very likely that any Tcl programmer will find something of use in it.

The general-purpose Tcl programming extensions include Tcl-DP, for distributed processing; TclX, with many new Tcl commands; and Expect, the extension that makes it easy to control other programs from Tcl.

The graphics extensions covered include BLT, which has a graphing widget that cured me of gnuplot; TIX, with more GUI widgets than I could ever use; and [incr Tk] and [incr Widgets] for those who prefer object-oriented programming techniques.

The special-purpose applications covered include TSIPP, a front end to the SIPP graphics-rendering library that is lots of fun (but you can burn up a lot of cycles playing with it); GroupKit, for building groupware packages; and SybTcl and OraTcl, the Tcl front ends to the Sybase and Oracle database libraries.

Each of the chapters is actually written by a different author, usually the author of the package. Most of the chapters stand alone; thus, you can pick up the book and read chapters at random. The exceptions to this are the second and third chapters on [incr Tk] and [incr Widgets], respectively, which assume you're already familiar with [incr Tcl], which is covered in the first chapter.

As with any work of multiple authors, the style and content varies from chapter to chapter. Some are sufficiently detailed tutorials that you can start using the package with no other reading. Others provide more of a high-level introduction that gets you started and makes the man pages accessible.

I found that I could use the BLT package after reading George A. Howlett's chapter without needing to check the man pages for more details.

Don Libes points out in his chapter on Expect that an entire book could be written about Expect (which is what he did), but he provides a good introduction to the more commonly used commands. I could start writing useful programs after reading his chapter, but would need more information to write a major project with Expect.

Mark Diekhans's chapter on TSIPP didn't give me the information I needed to create the nifty images I wanted to create, but it gave me the overview I needed to understand the man pages. Man pages provide a lot of detailed information, but they usually don't tell you where to start or provide the examples that show how to use a package. I wouldn't have been able to start using TSIPP without this chapter.

The other chapters in the book left me feeling secure that I could sit down and start writing code, although I haven't had the time to prove the fact empirically. Overall, this is an excellent book. I highly recommend it to anyone working with Tcl/Tk.

 

?Need help? Use our Contacts page.
First posted: 17th September 1998 efc
Last changed: 17th September 1998 efc
Issue index
;login: index
USENIX home