return to first page linux journal archive
keywordscontents

What is Tcl/Tk?

Tcl (Tool command language) is a freely available simple, interpreted language designed to be used as a common extension and customization language for applications. It was designed and implemented by Dr. John Ousterhout in the hope that application designers could spend more of their time on applications and less on scripting languages, and that users could spend less time learning new scripting languages for each new application. Many useful applications, some of them sold commercially, use Tcl as their scripting language.

Tcl is clean and regular, and relatively easy for non-hackers to learn. It is command-oriented, and commands added by applications and users exist on an equal footing with the built-in Tcl commands. Tcl has both simple variables and associative arrays (tables), and all values (including procedure bodies) are represented as strings. Simple customization scripts (such as preference initialization scripts) usually look much like novice users expect: a series of simple commands used to set options.

Tcl is implemented as a C library, which can be embedded in an application. The application can add its own commands to the interpreter (using a clean C interface). It is distributed under a license which allows use for any purpose with no royalties.

The Tk toolkit is a Tcl extension (a group of new Tcl commands) which provides a Tcl interface to the X Window System. Tk is one of the easiest ways to build a graphical interface to an application, and due to the interpreted nature of Tcl, Tk-based interfaces tend to be much more customizable and dynamic than those built with one of the C or C++-based toolkits. Tk implements the Motif look and feel. A number of interesting X applications are implemented entirely in Tk, with no new application-specific commands at all. Tk also provides a mechanism by which one application can send Tcl scripts to other Tk-based applications running on the same display, for easy cooperation between tools.

For more information write to Glenn Vanderburg at glv@utdallas.edu or see news://comp.lang.tcl/tcl-faq.part.01/.