The 2007 Tcl Conference was held in New Oleans, LA in the heart of
the French Quarter. As ever, New Orleans was a treat to visit.
Our invited guest was
Miguel has been active in reworking the Tcl interpreter internals and
explained the rationale and results of
The Great (internal) Var Reform of 2007
Our Keynote speaker was
Damon Courtney with a talk on
developing seamless cross platform applications with Tcl/Tk.
A copy of the proceedings can be purchased as hardcopy at the
Association Press storefront
GUIs and GUI Techniques
Making Beautiful Graphs with ZPlot
This paper introduces Zplot, a Tcl library for making two-
dimensional data plots. Zplot provides a simple set of
primitives that allow users to input and manipulate data,
plot said data in a variety of formats, and decorate the re-
sulting graphs with axes, labels, and other textual accents.
Zplot then outputs encapsulated PostScript for ease of in-
clusion in technical documents.
Tcl/Tk Tools for EPICS Control Systems
The Experimental Physics and Industrial Control
System (EPICS) is a control system in wide use in the control
systems of accelerator laboratories across the world as well as in
large-scale particle physics experiments. This paper will describe
a Tcl package that provides access to EPICS control systems and a
set of widgets that allow user interfaces to EPICS systems to be
easily constructed. The extension will be compared and contrasted
with the et_wish EPICS aware extended wish, and a justification
for choosing to write a new extension will be given.
Tcl/Tk Development and Debugging Tools
XTrace: A High Level Extension of Tcl Trace
In this paper two Tcl-packages written in pure XOTcl are
presented. The first "Xcom" is yet another socket-communication
package; the second "Xtrace" uses Xcom to provide an observer
command across multiple processes called "xtrace" that is
modeled along the lines of the well-known Tcl "trace"
command, but much more high-level.
Eti: An Extensible Framwork For Creating Applications
Writing a complete editor is possible after one month of learning TCL!
Usage of object orientation seemed to be a good idea: Have a mini
editor for any kind of text. Derive HTML editor, TCL editor etc. from
this. Have a set of classes needed for graphic programs, derive
different graphical drawings / simulations from this. Specify a set of
common used actions to include into the menu or a toolbar Have multiple
instances of the same type, so can use a notebook with several tabs
incr TCl offering classes and incr TK offering megawidgets like
notebook seemed natural
But (1) ... incr TK seemed to be more complicated than necessary incr
TK seemed to be slow because of code overhead. This led to the development
of the Eti Framework.
The Great (internal) Var Reform of 2010
The Var struct used as internal representation for Tcl's
variables currently contains six pointers and 2 integers, or
32 bytes on a 32-bit platform. For variables in hashtables,
be they namespace variables or array elements, a hash entry structure consuming a further minimum of 24 bytes
(but typically 28) is also maintained.
These requirements reflect a history of the structure,
and are far from optimal. We will explain the requirements that have to be satisfiedd, how they gave rise to this
structure, and a way to thin them down considerably: compiled variables are reduced to 8 bytes (75% reduction),
hashtable variables to a grand total of 24 bytes (60% reduction) . Further performance advantages of the new implementation will also be described.
Tcl as Glue (Traditional Tcl)
Tcl In the Middle
Tcl has long been recognized as an excellent language to glue existing components together to
create new applications. Tcl is just as useful when interjected into the middle of functioning
N-tier "enterprise" systems.
SockSpy is probably the best known example of a "man in the middle" Tcl application.
What may not be as widely appreciated, however, is that Tcl's strong TCP sockets and event-
drive I/O make construction of custom "man in the middle solutions" (or proxies) quite straight-
These custom solutions solve real business problems often at a fraction of the cost of other
potential solutions. This paper will look at a handful of examples where Tcl has been employed
in this manner at Intermountain Healthcare.
Kevin B. Kenny
An ODE Solver for Tcl: Old Fortran in a New Interface
LSODAR is a Fortran subroutine for integration of ordinary differential equations that
has been actively maintained for over twenty years and gives high-quality results for a
variety of problems. This paper demonstrates how such a "dusty deck" can be adapted to
interface cleanly to a modern high-level language like Tcl, be made safe to use in the
presence of threads and recursion, and take advantage of the symbolic computation
capabilities available to Tcl. The result is an ODE solver for Tcl that is production-ready,
at the expenditure of considerably less effort than it would take to develop comparable
capabilities targeted specifically at Tcl. It presents a few tricks that should be handy in
connecting other legacy Fortran applications to Tcl.
Anatomy of a Large Application: Architectural Patterns and Solutions
JNEM, the Joint Non-kinetic Effects Model, is a large simulation
application. Written almost entirely in Tcl/Tk, it makes
architectural use of the Snit object system and the SQLite3
database engine. This paper addresses a number of architectural
patterns and solutions that have been found useful during the two-
plus years of JNEM development. Patterns include the three-layer
package architecture (application, domain, and utility); Snit types
as application modules; saving and restoring application state; the
database-backed objects; SQLite3 as an application memory
debugger; and a generalization of the scrollbar/scrollable pattern.
Twelve Years of TclTutor
TclTutor is a Computer Aided Instruction application for learning
the Tcl programming language.
This paper discusses the application's development and some of
the technical details, along with lesson's learned and potential
Tcl Does Data(bases)
General Purpose Database Interface Adaptor for Tcl
TDIF is a uniform methodology for accessing external data within Tcl.
Its genesis stems from a need on my part to have the same software run under multiple platforms
with different drivers to access MySQL. One distro of linux would ship with tclmysql. Another would ship
with mysqltcl. Windows ships with tclodbc. And then there was the change in mysqltcl's interface
between mysql_ and mysql::.
At the same time sqlite was coming into it's own, and I found myself replacing some MySql
applications with it. I was also having to occasionally dump data out of MS Sql and MS Access. Being a
lazy programmer, I developed a shorthand for all of the various database interactions I needed, and
then wrote a suite of tools to convert that shorthand to the native interface of the storage engine.
TDIF is my attempt to adapt my own techniques, developed over time, into a formal interface.
GEB: SQLite in Tcl/Tk
Speed tables provides an interface for defining tables
containing zero or more rows, with each row containing
one or more fields. The speed table compiler reads the
table definition and generates C code to create and manage
corresponding structures, currently producing a set of C
access routines and a C language extension for Tcl to
create, access and manipulate those tables. It then compiles
the extension, links it as a shared library, and makes it
loadable on demand via Tcl's "package require" mechanism.
Speed tables are well-suited for applications for which
this table/row/field abstraction is useful, with row
counts from the dozens to the tens of millions, for which
the performance requirements for access or update frequency
exceed those of the available SQL database, a C compiler chain
is available, and the application does not require "no transaction
loss" behavior in the event of a crash.
GEB is a Tcl/Tk program for displaying and
manipulating SQLite databases. Each of its
major functions is stored in an SQLite table. It
has much of the functionality of the SQLite
stand-alone executable, plus spreadsheet-like
table display, nearly complete ALTER TABLE
functions, SQLite version 2 to version 3
conversion, the ability to execute a table as
either SQL or Tcl, and a few other functions I
had a need for. The name GEB was chosen
because using an SQLite database to store the
program which displays and modifies the
SQLite database itself seemed reminiscent of the
"self reference at a higher level" which was a
recurring theme in the book "Godel Escher
Bach: An Eternal Golden Braid." If you insist
on interpreting it as an acronym, it could stand
for "Gerry's Experimental Box," but that is
really a backronym.
Tcl Does Web
Using and Providing Web Services in Tcl
This paper discuss how to call Web Services from Tcl
using the WebServices for Tcl package and how to provide,
under Tcl based Web Servers, WebServices written in Tcl.
Also discussed is how Web Service data is represented in Tcl.
Donal K. Fellows
OO For Tcl
For the past two years, I have been working on developing a new OO system for
Tcl that is intended to serve as a basis for a wide range of OO styles. In this pa-
per, I will describe and explain the current status of the work, discuss the issues
involved in producing a high-performance flexible OO system, and describe a
number of issues that have been encountered during work (with Arnulf Wiede-
mann) to build a version of [incr Tcl] on top of the core OO system.
Kevin B. Kenny
Symbolic Differentiation in Tcl: Re-using the Tcl Parser for Symbolic Algebra
Philip J. Mercucio
Poet: An OOP Extension to Tcl Supporting Constraints, Persistence, and End-User Modification
Symbolic differentiation is one of the easier problems in symbolic algebra; it is often
presented as a student exercise in artificial-intelligence courses. Even though it is easy, it
remains useful (and often underutilized) for mathematical computations such as root-
finding, minimization and maximization of functions, and solving ordinary differential
The most time-consuming part of writing a symbolic differentiator, in many languages, is
writing a parser for the expressions to be differentiated. Fortunately, Tcl, being an
interpretive language, comes with a parser for expressions that is available at run time.
While the parser is not normally exported to scripts, the parser interface that the
instrumentor in TclPro uses allows for script access via an extension. One advantage to
using the built-in parser is that the programmer can be certain that the language of
expressions to be differentiated is exactly the language of expressions to be evaluated.
Poet (Prototype Object Extension for Tcl) extends the Tcl
language with objects featuring dynamic, prototype-based
inheritance, persistence, and one-way constraints between
object attributes. Poet includes wrappers around the Tk and
BWidget widgets that are automatically generated using
introspection. This paper also describes Poetics (Poet
Integrated Construction Set), a sub-project within Poet to
create tools to allow a Poet application's code and user
interface to be modified by the end-user, from within a
running Poet application. The goal of Poetics is to provide
some of the functionality of an integrated development
environment to the user of a Poet application. An object
inspector and code editor are the beginnings of the Poetics