Course Availability

This course is being offered internally to U. of C. Library Systems
staff only.

Course Prerequisites

Some previous programming experience.

Working knowledge of any Unix text editor (emacs, vi, axe, etc).

Emacs Tutorial

On Tuesday 12 July 1994, I will offer a
tutorial introduction to the
Emacs text editor to anyone who would like to attend.
The tutorial will be held in
BSLC-018,
the lab-like classroom in the basement of the Biological Sciences
Learning Center.

Course Schedule and Location

Lectures for the course will be Tuesday-Thursday, 3:00-4:30.
The first class will be 14 July 1994.
The course will last approximately eight to ten weeks.

Classes will be held in
BSLC-018,
with the exception of 21 July and 2 August, when the room is busy.
On these two days we will meet in JRL-124.

Tentative Draft Syllabus

The course will cover basic Extended Tcl programming, with coverage of
simple Expect programming, Tcl-DP, and some very minimal exposure to
Tk. This syllabus is subject to change, and depending on the speed at
which the course progresses, we may not get to cover everything
listed: in other words, we won't rush the course.

An Overview of the Tcl Programming Language

Tcl (pronounced Tickle) is a general purpose programming language
originally intended to be embedded in other applications as a
configuration and extension language. The success of one its most
important embeddings, the Tk toolkit for the X Windows System, has
resulted in Tcl and Tk together being most heavily used for building
graphical user interfaces (GUIs). It is also heavily used as a
scripting language like Awk, Perl or Rexx, and (as Expect) is used to
script interactive applications (e.g., to automate telnet logins to
various information vendors).

Here in Library Systems at The University of Chicago we already use
Tcl:

as a general-purpose scripting language to write Unix applications;

to automate login scripts for telnet connections;

as the programming language for the Reserve System.

In addition, a number of our Unix applications are written in Tcl (see
below), and Tcl is the programming
language of the University of Chicago BSDAC Phoenix Project.

Tcl is a successful language:

The Tcl/Tk developer community now numbers in the tens of thousands
and there are thousands of Tcl applications in existence or under
development. The application areas for Tcl and Tk cover virtually the
entire spectrum of graphical and engineering applications, including
computer-aided design, software development, testing, instrument
control, scientific visualization, and multimedia. [...] Tcl and Tk
are being used by hundreds of companies, large and small, as well as
universities and research laboratories.[1]

The companies using Tcl include SCO, Digital, Cray, AT&T, and Sun
Microsystems. John Ousterhout, the designer of Tcl/Tk, has recently
moved to Sun Microsystems from UC Berkeley to head up a group
dedicated to Tcl/Tk; he has made some comments on
Tcl's future at Sun.
There is an annual international Tcl conference which has been held
twice so far, and a safe variant of Tcl has been proposed as the
language for Enabled Mail in the Internet Multimedia Mail standard
(RFC 1341).

Tcl is virtually unique in the combination of features it offers:

Scripting Language

Tcl is a powerful scripting language that runs under Unix, Linux, VMS,
DOS/Windows, OS/2, and MacOS (at least). It provides all the usual high-level
programming features that we've come to expect from languages like
the Unix shell, Awk, Perl, or Rexx, such as:

Variable-length strings

Associative arrays

Lists

Keyed lists (aka structs, structures or records)

Pattern matching with regular expressions

Ability to define or redefine procedures at run-time

Full file access

Error handling

Embeddability

Tcl is a small language designed to be embedded in other
applications (C programs for example) as a configuration and extension
language.
This minimizes the number of languages that users need to learn in
order to configure their applications, and makes these applications
programmable with no extra effort.
In addition, Tcl is a complete and well-designed programming
language, whereas many existing configuration languages were designed
(to be kind) in an ad hoc manner.

Extensibility

Tcl is specially designed to make it extremely easy to extend the
language by the addition of new primitives in C. These new primitives
are truly first-class citizens of the language, sharing the same error
handling and memory management as the original primitives. This has
led to many useful extensions, such as DBMS access (extensions
exist for Oracle, Sybase, Ingres, Postgres and many other DBMS's),
SNMP, Motif, etc. In addition, this allows Tcl programs to be
optimized by moving time critical code into C.

Equivalence of Data and Programs

Like Lisp, Tcl uses the same representation for data and for
programs. This means that Tcl programs or scripts can be manipulated
as data: stored in variables, written to and later read from files or
databases, passed from one Tcl program to another across the Internet,
etc. In addition, it means that the programmer can create new Tcl
control structures or error handling routines as easily as writing a
simple function.

Automatic Memory Management

All Tcl data structures are dynamically allocated and fully
variable in size. The programmer never needs to allocate memory or
specify maximum sizes.

Event-Driven Programming

Tcl supports event-driven programming (required for GUI
programming) with the ability to associate Tcl code with any variable
or array element (the code is executed automatically whenever the
variable is read or written).

IPC Between Multiple Tcl Applications

Tcl supports the passing of Tcl code as messages between Tcl
applications running on different machines across the Internet. This
allows client-server protocols which incorporate the full power of the
Tcl language, and makes it possible to write very tightly-integrated
applications.

Tk is a Tcl embedding of Ousterhout's Tk toolkit for the X Window
System. With Tk, the Tcl programmer can create GUI applications in a
fraction of the time and code required if programming in a low-level
language like C. There is also a very full-featured GUI builder for Tk
called xf which allows you to build live interfaces without
writing any code.

The Expect Scripting Language

Expect extends Tcl to allow scripts to control interactive
applications which can't otherwise be programmed. It is similar to the
scripting languages found in software terminal emulators like
Crosstalk and Kermit, but isn't restricted to scripting access to
communications ports.

Tcl-DP adds a native (i.e., Tcl-based) remote procedure call
interface to Tcl that makes it possible to write tightly-coupled
networked applications. Using Tcl-DP, an application running on a
machine elsewhere on the Internet can respond automatically to the
modification of a variable in a local application.

Groupkit is a groupware toolkit designed to make it "easy" to develop
multi-user applications for real-time distributed desk-top conferencing.
The philosophy is that groupware development should be only slightly more
difficult to code than single-user programs.

Safe-Tcl

Designed primarily for Enabled Mail applications, in which
electronic mail messages can contain "live" code to be executed
automatically when received, Safe-Tcl is a Tcl interpreter that
doesn't allow any "unsafe" commands to be executed -- commands that
might delete files or otherwise destroy valuable data. It can be used
in any distributed application.

Here are few example Tcl and Tk applications (as opposed to the
extensions above), most of which we run on our system: