DIVE TCL Interface

DRAFT
Principles and Guidelines

Emmanuel Frécon
The Swedish Institute of Computer Science
Stockholm March 28, 1995


This text describes the guidelines of a recent effort which tends to replace the current behaviours attached to objects by scripts written in a "real" programming language. Even if the recent developments of the behaviours add testing guards in state transitions, and thus making loops possible, it appeared to us that further enhancements would lead to the development of our own programming language. Instead, we currently try to attach scripts written in a programming shell language (currently TCL) to objects.

TCL has been choosen for a number of reasons, among which:

Programming behaviours in TCL is not anymore based on a state machine. Instead, it is done in a way similar to programming a DIVE application. Registered TCL procedures are called each time a DIVE event occurs. There are no limit to the number of procedures an object can register for a given event. As in C, and opposite to current behaviours, all the arguments carried by the incoming event are given to the procedure as arguments. For example, a procedure listening to incoming interaction signals can know which person has sent the signal, and which object (hand) it is coming from.

Scripts can use the usual looping and testing statements of TCL. They can also use local variables (global variables should use DIVE properties). In addition, specific DIVE commands are offered to them, most of them correspond to the distr_ functions, some others can access DIVE database. Follows an open-ended list:

Given such a set of commands, vishnu (the successor of the visualizer) can offer, at no cost, a TCL prompt in its starting window: it is then possible to interactively enter DIVE and TCL commands and watch the result.

PS: Note about properties: Properties are variables of any type and name that DIVE application can leave in objects and distribute. Standard types such as int, strings, ... and also point, object identifiers, ... are supported; new types, only supported by some applications running in worlds are also possible.