Preface

Introduction

Welcome to Modern Application Development in Tcl/Tk! This book aims to provide a complete introduction to developing applications in Tcl/Tk, and to emphasise modern software development methodology throughout. The book is intended as a free companion and eventual replacement for the existing Tcl Tutorial [5], written by Clif Flynt, Arjen Markus, David N. Welton and Neil Madden. Some material from that tutorial has been reused in this book, but the majority has been heavily edited or rewritten from scratch to reflect current best practices.

Tcl stands for the ‘Tool Command Language’. It was originally developed in the 1980’s by Dr. John Ousterhout, then a Professor of Computer Science at the University of California at Berkeley, as a lightweight embeddable command language for a number of software tools developed by Dr. Ousterhout and his students. The idea was that Tcl would provide some basic facilities common to all programming languages, such as variables, loops, and control structures, and then a host application could embed the language and extend it with new commands relevant to that tool. Users could then use Tcl to control the tool by issuing commands, either interactively or in batch scripts. You can read more about the history of Tcl at http://www.tcl.tk/about/history.html.

Tcl still excels as an embedded command language, but it has also developed into a fully fledged general programming language. The core principles that made it such a good command language: simplicity, extensibility, and ease of integrating different components, have also stood Tcl in good stead as a general purpose language. Today it is used for everything from modern desktop applications, to heavy-duty network servers, and lots in between.

Outline of the Book

The first part of the book introduces the Tcl language, from basic facilities through to advanced topics such as developing custom flow control constructs and event-based TCP/IP networking. Don’t Panic! No previous knowledge of Tcl/Tk or even programming in general is assumed in this book. Feel free to skip the more advanced chapters to begin with, and then come back to them when you feel more comfortable with the material. The remaining parts of the book introduce a number of popular extensions to Tcl for developing sophisticated applications:

This book doesn’t currently cover the implementation of Tcl or how to extend or embed Tcl from C or C++. These advanced topics are covered by the Tcl manual pages and a number of other books on Tcl.

Additional Resources

The Tcl community is an exceedingly friendly one. Here are some good places to get help:

Contributors

The following people have contributed material to this book: