next up previous index
Next: Why Xlib? Up: Introduction Previous: Introduction

Why Tcl/Tk?

We have selected Tcl/Tk among several possible candidates for a GUI toolkit for Prolog. It was a surprisingly clear winner, for several reasons:

The X toolkit Tk is itself tightly coupled with the Tcl language, which has advantages (it provides various mechanisms not available in Prolog) and disadvantages (no modularity, the current interpreter is slow), but after all it is quite natural to use an imperative language to express the properties of a GUI and Tcl is acceptable for this.

Our Tk interface is quite loose, we do not map Tk commands to Prolog predicates, all Tk's functionality is accessed through the Tcl interpreter (unlike e.g. the Tk interface to Scheme). There are several reasons why we prefer such a loose interface:

The ProTcXl interface allows to invoke Tcl commands from Prolog and vice versa as wella s to handle X11 events in Prolog. It is usually not necessary to exploit all available Tcl features when programming GUIs for Prolog, because often most of the processing is done in Prolog itself. Sometimes, however, it may be an advantage to separate different functionalities and to let Tcl execute more complex operations than just displays.



next up previous index
Next: Why Xlib? Up: Introduction Previous: Introduction



Micha Meier
Tue Jul 2 09:49:39 MET DST 1996