TIP #12: The "Batteries Included" Distribution

Title:The "Batteries Included" Distribution
Version:$Revision: 1.3 $
Authors: George A. Howlett <gah at siliconmetrics dot com>
Larry W. Virden <lvirden at yahoo dot com>
Created:Friday, 15 September 2000
Discussions To:news:comp.lang.tcl


This document describes a comprehensive Tcl/Tk distribution. Its primary purpose is to create a standard source tree that includes Tcl, Tk, and extensions so that they can be built and installed in an simple and easy manner.


One of the most enduring complaints about Tcl/Tk is that it lacks features, especially when compared to Perl, Python, or Java. We patiently explain that some particular feature is available in extension "XYZ" only to hear how hard it is to build and install extensions.

Frank Stajano ("The SMS server, or why I switched from Tcl to Python") describes the problem succinctly.

"But if I had to put the finger on the single most important reason that has me now working in Python rather than in Tcl/[incr Tcl] it would not be a language issue but a library issue. I prefer Python because its standard library is a gold mine. Sure, for anything I want to do there's bound to be an extension available in the Tcl code repository on the FTP site. Now I just have to find it, fetch it, recompile the interpreter with it (Oh wait - this may mean getting and installing a C compiler for this system. Will the GNU one compile the windowing stuff properly or do I need to get VC++, or Borland? Who wants to have some fun discovering where another IDE has hidden the useful compiler flags this week?), hope that it won't clash with other extensions I've had to install, hope that it will not require a different version of the interpreter from the one I am running, and so on. Python supports the same C extension mechanism as Tcl - but the practical difference is that the stuff I want is, most of the time, already included and shipped in the standard distribution of the language!"

"But, as a general-purpose tool, Python's single most important selling point is the richness of its standard library - an idea that Tcl is only now starting to internalise. It's all in the distribution. You can attack your practical problem using the stuff that's already installed on your system, and documented in the library manual you already printed. Python is great because it comes with batteries included."

It's true. There are too many things to know to maintain even a moderate set of extensions. There are too many different places to download extensions, too many extension-specific configuration options, etc.

My hope is that this proposal will mark the beginning of the end of the "Batteries Included" problem. One evidence of success will be that words "core" and "extension" disappear from our Tcl vocabularies. We've lived their artifical distinctions that are useful only to core developers and extension writers. It's skewed our thinking about relationship between Tcl and its parts. After all, application writers first care about whether a feature or capability is available, not how it's structured under the hood.

The "Batteries Included" Distribution.

Let's start with a very modest example. Let's imagine that the "Batteries Included" distribution is nothing more than an archive file of the source code for Tcl/Tk and several extensions.

            Unix    Windows  Mac
             ----    -------  ---
  Tcl 8.3       x       x      x
  Tk 8.3        x       x      x
  [incr Tcl]    x       x      x
  expect        x       ?
  TclX          x
  BLT           x       x
  Html widget
  ...lots more...

Tcl, Tk, and the packages are configured such that they can be built and installed just from a top level directory (not individually). Someone can download and try out all sorts of new features without repeating the same "configure", "make", "make install" sequences.

With this simple tar file, the following benefits are automatically generated:


We want to create an open door procedure that makes it easy for contributors to add new features and commands to Tcl and Tk. By creating a framework for extensions to be built and distributed, the "Batteries Included" distribution will provide a path for great new features to quickly become available to the Tcl community.

The "Batteries Included" distributed is not designed to be one size that fits all. I assume there will be many distributions to suit many needs. There may be one for Tcl web servers and another for embedded systems. The goal is that the "Batteries Included" distribution will become a prototype for other distributions. Distribution creators will be able to pull code from the same CVS source tree.

What will distinguish the "Batteries Included" distribution is that it will be the most comprehensive and most up-to-date distribution. We will explicitly not choose one package or extension over another. That decision should remain with the Tcl user community. The only requirement is that the extensions are robust and/or actively maintained.

If the "Batteries Included" distribution is to become successful, it must be a cooperative effort between Tcl core developers, extension writers, and the Tcl user community. For example, we need the help of extension writers to adopt the new configuration scheme and directory structure.


We can stage the project with small milestones while still focusing on longer range goals. For example, the first phase can be as simple as creating a tar file. It will start to address questions that were raised by TEA. For example, how do we manage documentation?

The biggest reason why this proposal will succeed is the incredible talent in the Tcl community. We can leverage the skills and experiences of the foremost experts on the core, extensions, and applications.

Tcl/Tk Version.

The distribution will be based on 8.3.2 (or 8.3.3 when it is released). While there's no assurance when 8.4 will be released and in what state, we also want to place a premium on stable, robust extensions, that have been thoroughly tested. Most extensions will be unlikely to have been tested against the 8.4 alphas.

Phase 1.

Phase 2.

Phase 3.

The last phases are sketchy. Feel free to add to this list, further breaking down goals into subtasks.

Open Issues

More Information

If anyone has interest to participate or would like to add comments to the "Batteries Included" proposal, please send mail to George Howlett <gah at siliconmetrics dot com>.


This document has been placed in the public domain.

See Also

TIP #4 by Brent Welch <welch at acm dot org>.

Powered by Tcl[Index] [History] [Edit] [HTML Format] [Source Format] [LaTeX Format] [Text Format] [XML Format] [*roff Format (experimental)] [RTF Format (experimental)]

TIP AutoGenerator - written by Donal K. Fellows