Version 8 of big wish

Updated 2003-09-11 17:36:07

C programs of a particular type are known as big wish programs. They have this name because of their similarity to the wish program that is part of Tk.

Unless you are completely new to Tcl/Tk, you are familiar with the program tclsh. With tclsh you can interactively enter Tcl commands and see the results of their evaluation. Or you can name a script file for tclsh to evaluate. The Tcl interpreter within tclsh starts out with all the built-in commands provided by the Tcl package.

The program wish is quite similar to tclsh. The primary difference is that the Tcl interpreter within wish starts out with all the commands provided by both the Tcl and Tk packages. The commands of two packages are combined in one interpreter right from the startup of the program.

A big wish program is one like wish that combines Tcl and one or more packages in one program. Examples include:

  • expect - includes Tcl and Expect packages
  • expectTk - includes Tcl, Tk, and Expect packages
  • tcl - includes Tcl and TclX packages
  • itclsh - includes Tcl and Itcl packages

...and there are others.

In the early days of Tcl, the construction of a big wish program was the only way to extend Tcl with commands provided by an extension.

One challenge in those days was if you had a Tcl script that made use of commands provided by a package other than Tcl, you had to be careful to choose the right big wish to evaluate that script, so that it had access to all the commands it used. For example, if your script used the signal command, it would need to be run with the tcl program, and not with the tclsh program.

As of 2003, these big wish programs are falling out of favor. Replacing them is the practice of making each component package available as a loadable extension, so that each package can be pulled into the tclsh program at runtime, as they are demanded by scripts evaluating [package require] commands. This is an example of the extending solution winning out in the embedding vs. extending contest.