Practical Programming in Tcl and Tk

Practical Programming in Tcl and Tk

Authors: Brent Welch

Pages: 455

Publisher: Unknow

ISBN13: 9780131820074

I first heard about Tcl from John Ousterhout in 1988 while I was his Ph.D. student at Berkeley. We were designing a network operating system, Sprite. While the students hacked on a new kernel, John was writing a new editor and terminal emulator. He used Tcl as the command language for both tools so that users could define menus and otherwise customize those programs. This was in the days of X10, and he had plans for an X toolkit based on Tcl that would allow programs to cooperate by communicating with Tcl commands. To me, this cooperation among tools was the essence of the Tool Command Language (Tcl).

That early vision imagined that applications would be large bodies of com-
piled code and a small amount of Tcl used for configuration and high-level com-
mands. John’s editor, mx, and the terminal emulator, tx, followed this model.
While this model remains valid, it has also turned out to be possible to write
entire applications in Tcl. This is because of the Tcl/Tk shell, wish, that provides all the functionality of other shell languages, which includes running other programs, plus the ability to create a graphical user interface. For better or worse, it is now common to find applications that contain thousands of lines of Tcl script.

This book came about because, while I found it enjoyable and productive to
use Tcl and Tk, there were times when I was frustrated. In addition, working at
Xerox PARC, with many experts in languages and systems, I was compelled to
understand both the strengths and weaknesses of Tcl and Tk. While many of my
colleagues adopted Tcl and Tk for their projects, they were also just as quick to point out its flaws. In response, I have built up a set of programming techniques that exploit the power of Tcl and Tk while avoiding troublesome areas. Thus, this book is meant as a practical guide that will help you get the most out of Tcl and Tk while avoiding some of the frustrations that I experienced.