[Home]Practical Programming In Tcl And Tk

Practical Programming in Tcl and Tk
Brent Welch, Ken Jones, Jeffrey Hobbs
Prentice Hall, Paperback, 4th Bk&CD edition
Published June 2003, 882 pages ISBN 0130385603 (amazon.com, search)

Tcl is a small (read "good" and "orthogonal"), stable, mature, and featureful language. And (to paraphrase Brian Kernighan, referring to his book The C Programming Language), it is served well by a, um, well not a small book, but by one book in particular, this one.

The [Tcl] programming language is perhaps the single most underappreciated and underestimated programming language currently in general use, followed a close second by Ruby (Ruby, is however on the ascent, while Tcl seems to be spiralling downward out of view, this second fact should be considered a criminal occurrence of the highest order, as we shall see). Tcl is, however, the language of choice for a number of very significant projects, AOL Server, IBM's WebSphere, and the data access and analysis system of the Laser Interferometer Gravitational Observatory are all Tcl projects of considerable magnitude. Tcl has been shown to be stable and scalable in these environments. I know, because I wrote the management layer for the LIGO data system, in Tcl.

Tcl has a few things in particular going for it that should, really, make it the first choice for system administrators and network application developers, in spite of claims made for these areas by another well known language.

What makes Tcl special? Well, first of all, the core language contains a nearly perfectly implemented socket abstraction layer that allows one to write network applications that are secure and well-behaved (and fast!) with great ease. Second, the language is designed around a thing called an event-loop that endows the language with almost magical multitasking power (without the hazards of threads).

Another attribute of Tcl, which frankly has no interest for me, but is possibly more significant for others than the things I have mentioned so far, is that an enormous effort has been made to make Tcl behave transparently under all flavors of UNIX, under (ugh!) Windows, and under MacOS. This interoperability extends to the Tk graphical windowing toolkit, which makes use of native look-and-feel on all platforms, and does an amazing job of it. The result is that, even more so than for JAVA, Tcl code will run right nearly everywhere. And the particular wonders of unices are leveraged using a single extension library, [TclX].

Brent Welch understands these aspects of Tcl, and pretty nearly all of the others in great detail. And he makes his knowlege available and readily accessible in this book.

Over the course of 4 editions the Tcl language has grown and Brent has kept up to date perfectly. And the quality of the book has grown as well, with an (finally, geez, some of us were chewing off our fingernails over this one) excellent index, and a much improved binding and paper stock (the book lies flat on every page, except the first and last 24; damn good for a nearly 900 page book!)

The book is organised into seven logical partitions (with a thumb index printed on the page edges):

  1. Tcl Basics - how to get started writing Tcl code in 2 minutes
  2. Advanced Tcl - events, security, optimisation, and magic
  3. Tk Basics - how to get started writing GUIfied apps in 10 minutes
  4. Tk Widgets - the gory details of all options to the widget set
  5. Tk Details - things that you can do to change Tk's default appearance

  1. Tcl and C - The C API for extending and embedding Tcl
  2. Changes - A comprehensive list of changes to the Tcl language and C api from Tcl version 3.6 (1985?) to 8.4 (2003). With porting tips!

If you only own one Tcl book (and, frankly, you only need one, because the Tcl language has few dark corners, and because the book is nearly perfect) this has got to be it. If you do not have this book you are not using Tcl to it's full potential.

A veritable treasure trove of Tcl code examples and expert help with Tcl and Tk is available at: http://wiki.tcl.tk

If you are not using Tcl at all, you are not coding as productively as you could be, and your networked apps are not as secure as they could be, and probably run damn slow (well, Apache with the Perl module is damn fast, but it has been my experience that the typical Perl cgi script is a security nightmare. It is easier to write a secure custom server in Tcl than to do the equivalent in Apache/Perl, though Apache does offer sufficient security options to keep the lid mostly in place, Perl is a sloppy language that seems to attract sloppy coders ;^)).


Buy it at BookPool for 22% off: [Buy It!]


Thanks for the great review! Visit http://www.beedub.com/book for sample chapters and Errata for all editions. - Brent Welch

Silverlake Linux Users Group Wiki | Recent Changes | Preferences
Password required to edit | View other revisions
Last edited December 22, 2004 9:19 pm by Phil (diff)
Search: