What are Tcl and Tk?

Tcl (Tool Command Language) is a free, open-source, command based scripting language originally developed by John Ousterhout and distributed from the Tcl Developer Exchange. It is used by applications which contain a Tcl interpreter, the most common being tclsh, which parse and run commands read from the command line or a script file. It has a well-defined syntax similar to C-shell and perl, a rich set of built in commands, provision for user defined commands which are compiled into byte-code whenever possible, and a programming interface for creating extensions that can be compiled, usually with C, and linked into specialized applications or loaded from libraries at run time. The most frequently used extension is Tk (Tool Kit), which adds commands for creating and defining behavior for graphical interface items such as buttons and menus. Tk is most often run by the wish (windowing shell) application. Scriptics has a primer with some basic discussion and examples, plus links to more information. There are also several well written books on it. My favorites are Tcl and the Tk Toolkit by John Ousterhout (from which I learned Tcl), Practical Programming in Tcl and Tk by Brent Welch and Tcl/Tk for Programmers by J. Adrian Zimmer. The "last word" is in the man pages, which are are well written and comprehensive.

There are many useful extensions to Tcl, some of which you will find at www.tcl.tk/software. They add commands for advanced object handling, specialized database access, high level widget management, and process automation, among other things.

Return to tkgeomap home