Tool Command Language

Tool Command Language (abbreviation: Tcl) is a script language originally designed in 1988 by John Ousterhout and his team at the University of California at Berkeley . It is mainly inspired by the languages C , Lisp , sh and awk . This dynamic typing language is multiplatform, extensible, easy to learn and based on twelve syntactic rules. Tcl interfaces very easily with the C language , which allows it to serve as aninterpreter embedded in applications.

In 1990, John Ousterhout developed an extension for Tcl called Tk which is a library for creating portable graphical interfaces. Thereafter, the development of Tk decoupled itself sufficiently from that of Tcl to be used with other languages. However, the combination of Tcl and Tk remains known as language under the name of Tcl-Tk or Tcl / Tk.

Tcl-Tk is part of the programming languages ​​with the homoiconicity property , just like Lisp . Numbers of computer scientists pronounce ” tickle ” when speaking of Tcl , which means tickling in English. Tk is pronounced ” ticket “.


Renowned for economical memory [ ref.  desired] , Tcl is an interpreted language platform.

One of the slogans of the language is summarized in the form of everything is a string (literal translation of everything is a string ): even the code defining a procedure can be manipulated as a string.

Moreover, everything within the language is a command: even statements like if or while are commands, and do not in any way belong to the syntax of the language. All commands, including assigning variables, can be overloaded .

Mathematical expressions are evaluated by a special order, with a syntax inspired by C .

Nested lists are one of the basic types of language, and allow for very concise functional programming . The syntax then becomes close to the prefixed notation .

The introspection of the interpreter provides access to the entire execution stack , and execute commands on a higher level (in the stack).

It is possible to define actions to be triggered on the reading or writing of a variable, as well as on the calling of a procedure.

The language also allows to define new control structures ( do .. until for example) in a few lines.

Strings meet the standard Unicode , and commands to convert strings between different encodings .

The sockets multiplatform managed both client side and server side.

Tcl allows the search and substitution of regular expressions .

Easy integration of native C, C ++ and Java code is possible.

Since the version of 8.6, Tcl has native object-oriented programming .


Tcl is easy to learn, especially for a regular C language or someone who knows a shell . Although the syntax seems at first quite similar to C, in truth it is much simpler. The language also has common aspects with Lisp and Forth . It can develop very quickly software for small or medium size. In addition, it is easy to integrate various other software with a HMI in Tcl / Tk.

Tcl is best known for its graphical extension Tk . Tcl / Tk allows you to design applications that are windowed independently of the platform ( UNIX / Mac OS / Windows ) in the same way as the Java language .

Since Tcl is an interpreted language, the development of a program is fast and can be done by successive keys. This working method corresponds to a cascade development cycle.

Tcl facilitates access to the functions of its interpreter, which contributes to the power of the language and places it halfway between a functional language like Lisp and an imperative language like BASIC .

Tcl is integrated or embedded with many applications thanks to its simple syntax (for example, Oracle ). One of its strengths is the easy realization of a series of unit tests for a given application. The easy implementation of validation tests makes incremental development very easy (in the manner of Forth ).

Syntax and semantics

The syntax follows the model of a shell , with some simplifications compared to languages ​​like perl or ksh. A Tcl script contains one or more commands. A command consists of one or more words, which are separated by spaces.

Word0 word1 word2 word3 ... wordN
  • The “” are used to group several words, and they will be considered as a single word (if there are references among these words they will be interpreted (substituted)).
  • The {} can play the same role (without interpretation of the variables) except in some cases.
  • The [] delimit calls of functions whose results we want to know.
  • The () indicate the indexes of the arrays T(38)is the equivalent of T[38]language C. They can also make it possible to order the calculations in the case of mathematical expressions.

The first word is the name of the command. The following words are the parameters.

Name of the command par1 par2 par3 ... parN

Instead of a parameter, [ ... ]another command can be enclosed in square brackets . This is interpreted first and the result becomes the parameter of the upper command. Between braces { ... }one can put as parameter a sequence of words which is not interpreted, but used directly. Parameter transfers are by value. The transmission by reference is done without putting $ before the name of the variable, and by the command upvarin the body of the procedure called. Constants or strings are indicated as they are. The comments are written after the command # (which is a command like the others but does nothing).

The assignment is done by the instruction set, which in passes returns the value.

% Set a 38

The value of a variable is obtained by [set a]. Note that this $ais only a shortcut for writing [set a].

Other examples of syntax:

% Set s [ Sum $ a 38 ]; # A,
transmitted by value, can not be modified ...
% Update ListA $ x $ y ; # ListA, transmitted by reference, is modified by MiseAJour

The usual notation x=f(y)is written in Tcl set x [f $y].

Type of variables

General information

Variables are not typed explicitly. Nevertheless, five can be defined:

  • The boolean : 0 / false / no / n / off (false) on the one hand and 1 / true / yes / y / is / (true) or a different number of 0 on the other;
  • The numbers : 3.14 1.e-10;
  • The strings : Hello, “Madame De Labas”, 32, {z 3.14};
  • The lists : booleans, numbers, strings or lists (we can nest the lists);
  • The associative arrays : T (key) M (2,3) which may contain the 4 preceding types, even if mixed.

The first four types are called scalar types, so they can be passed by value and returned to the call of a procedure. These scalar types are automatically converted to the proper type, for example, a character string can become a list:

% Set fruit apricot
 % puts $ fruits
% set fruits "apple orange banana"
% puts [ lindex $ fruits end ]

A function can return a string or a list, but not an array that is not a scalar variable. However, these may be transmitted by reference. The dictionaries (new in version 8.5) are a new scalar type, which can therefore be supplied as parameter of a procedure, and even returned.


% Foreach bool [ list 0 1 2 false true no yes ny ] {if $ bool { puts "$ bool => true" } else { puts "$ bool => false" }}
0 = > false
 1 = > true
 2 = > True
 false = > false
 true = > true
 no = > false
 yes = > true
 n = >False
 y = > true


Numbers are treated as strings except in arithmetic expressions where they are first converted to binary.

Associative Tables

Key-value associative arrays implement a hash table type , are very fast and can be very large. A key, index of the table, can be a string or a list, with no size limit. One can, for example, use a text of 10000 lines as a key.

Control Structures

Unlike other languages, the words used for Tcl control structures are not reserved words with a special syntax. “For”, “if”, “while” are procedures that obey the usual Tcl syntax.

 while { uneExpressionLogique } {
 If { $ x < 0 } {
 set x 0
 } elseif { $ x < 5 } {
 set x 5
 } else {
 set x 10
 For {set i 0 } { $ i < 10 } { incr i } {
 puts $ i
 foreach i [ list "youpii" "today" "it's nice" "bravo!" "Congratulations!" ] {
 Puts $ i
 foreach has $ listA b $ listB c $ LISTEC {
 puts "$ a $ b $ c"
 Foreach { x y } [ list M Gaston Miss Jeanne M Robert Raymonde ] {
 puts "$ x $ y"
 set blue
 switch $ color {
 red { puts "FF0000" }
 blue { puts "0000FF" }
 green { puts "00FF00" }
 white { puts "FFFFFF" }
 black { puts "000000" }
 default { puts "unknown" }


  • Factorial (in functional programming style ):
Proc ! X {expr { $ x < 2 ? 1 : $ x * [ ! [ Incr x - 1 ]]}}
  • Summing up a list of numbers

With a foreach loop running through the list:

Set numbers { 10 9 8 7 6 5 4 3 2 1 }
set sum 0
foreach i $ numbers {
 set sum [expr { $ sum + $ i }]

Or more compact using the command join :

Set sum [expr [ join $ numbers + ]]

Note that an operator is a character like any other, so it can be stored in a variable:

Foreach op { + * - / } {
 set result [expr [ join $ numbers $ op ]]
 puts "The result for the operator $ op is $ result"
  • Substitute characters according to a look-up table with the command string :
puts [ string map { GA R TC Y GT K AC M GC S AT W } $ sequence ]

Then give the frequency of occurrence of the letters (A, C, T, G) in the sequence using an associative array ( array), the command splitto isolate each pattern and the introspection ( info) command of the interpreter:

foreach nucleotide [ split $ sequence "" ] {
 if ! [ Info exists account ( $ nucleotide )] {
 set account ( $ nucleotide ) 1
 } else { incr account ( $ nucleotide )}
foreach nucleotide [array names account ] {
 puts "$ nucleotide -> $ account ($ nucleotide)"
  • Download an HTML page
Package require http
 puts [ http :: data [ http :: geturl http: // / tcl / 540 ]]
  • Give the time by text-to-speech Android
package require android
 set android [ android new ]
set time [ clock size [ clock seconds ] - size "% I% M% p on% A% B% e,% Y." ]
Android speak $ time

Difficulties and Pitfalls

Tcl is an extremely simple language, and very powerful. This is precisely what allows it to execute code that a compiler, or another interpreter would refuse … and give a result quite different from what the developer expected. The development sites under Tcl 2 give tips to beginners to make good habits.

Variable and literal names

Remember that a variable name can not be written differently from a literal.

% Puts x
% set xa
% puts "x $ x"
 x a
 % puts 0
% set 0 1
% puts $ 0


Substitutions can yield surprising results.

% Set x 1
% set yx
% set $ y 2 ; # Equivalent to set x 2
% puts $ x

There is no difference between the code and the data, in that any string can become code. Again, watch out for substitutions.

Set i 0 ;
Set cond1 "$ i <5" ; #! Caution, cond1 is already equal to the string "0 <5"
set cond2 { $ i < 5 }; #! Here, there is no substitution, cond2 is equal to "$ i <5"
set incre {set i [expr $ i + 1 ]; Puts $ i }
while $ cond2 $ incre ; # This loop runs 5 times.
Set i 0 ;
while $ cond1 $ incre ; # This loop never ends.

Traps in brackets, brackets, braces in comments

We are tempted to put pieces of code into comments. But in Tcl, it’s a bad idea.

Set x 1 ;
# Accolade groups are taken into account even in comments.
# If {$ x> 0} {# <----- commented line of code in which a closing brace is missing.
If { $ x == 1 } {
 puts "In clause if"
# From here errors can occur due to badly structured brace groups.
# The causes of this type of error are very rarely detected by an uninformed.

A proposed solution is:

Set x 1 ;
# Accolade groups are taken into account even in comments.
# If {$ x> 0} {} # <----- commented line of code in which the bracket groups are integers.
If { $ x == 1 } {
 puts "In clause if"
# From here, the braces are all integers.

Deployment and Execution


On Linux and other platforms derived from Unix, the Tcl-Tk interpreter is often installed by default. If this is not the case, it is necessary to compile the source code using a C compiler and then proceed with the installation. The execution of a Tcl code is done by entering at the shell prompt:

Tclsh file.tcl

Or by launching the interpreter via tclshand then entering the following line at the prompt of the interpreter:

Source file.tcl

However, a Tcl script can run directly (much like a shell script) by adding the following line to the beginning of the code:

#! / Usr / bin / env tclsh

On Windows, it is of course possible to compile the source code, but the best option still remains the installation of Tcl-Tk from a precompiled distribution. To execute a Tcl code, simply double-click it. Unlike Unix, there is no console open by default under Windows. In other words, if you execute a Tcl code by printing results on the standard output, nothing will be displayed. The following line must be added at the beginning of the code:

Console show

You can also use the interpreter wishthat also manages the Tk toolkit .


Starkit 3 is the acronym for “StandAlone Runtime called Tclkit”. It is a mechanism that consists in grouping in a single file all the elements that compose a Tcl-Tk application (sources, images, libraries, extensions, …) with the structure in a kind of virtual file system. The resulting starkit file, with extension .kit, is executed via Tclkit, a Tcl-Tk interpreter available for all target platforms. In terms of deployment, this means that there are two files to be copied to the disk: the Tclkit interpreter + the starkit. No need to install Tcl-Tk. Note that a starkit can be executed by a classical interpreter (tclsh, wish).


The Starpack 4 is an executable that incorporates the source code of an application in the form of a starkit with a Tcl-Tk interpreter. In terms of deployment it simply means that there is only one file. Its installation is to copy it to the disk and its uninstallation is to remove it from the disk. Unlike the starkit, the starpack is specific to the target platform. Again, no need to install Tcl-Tk.

Object Oriented Programming

Tcl has native object-oriented programming since version 8.6 (December 20, 2012). It is an object system based on classes , metaclasses , filters, slots and mixins . The syntax is as follows:

Object method arg1 arg2 ....


Oo :: class create DistributorTicket {
 variable counter
 Constructor {} {set counter 0 }
 method donneTicket {{ ticket 1 }} {
 incr counter
 for {set i 0 } { $ i < $ ticket } { incr i } {
 puts "Here's the ticket No. $ i $ counter to the command"
Set macommande [ DistributorTicket new ]
$ macommande donneTicket 2

The inclusion of the OOP in the Tcl core has been a recurrent topic of discussion within the user community of this language. Opinions were divided mainly for three reasons:

  • The OOP is not the only adaptable paradigm
  • A desire to preserve a compact core
  • The various possible adaptations of object concepts

For this latter reason, Tcl already had access to several object extensions.

Extension Implementation Description of the model
XOTcl C Dynamic definition of classes , metaclasses and methods with instrospection. Legacy single and multiple. Dynamic aggregation of objects, nested classes, mixins, conditional filters, slots. Influenced by CLOS , Smalltalk and Self .
Incr Tcl C Layered on object model of C ++ . Multiple inheritance. Private and public classes.
OTcl C Dynamic definition of classes, meta-classes and methods with instrospection. Simple and multiple inheritance. Influenced by CLOS , Smalltalk and Self .
Snit Tcl Model based on delegation instead of inheritance
STOOP Tcl Close to C ++ object model . Switch class.


Tcl is available for most commonly used platforms. That is to say, Windows CE / PocketPC / 9x / NT / 2000 / XP / Vista / 7, Mac OS 7/8/9 / X and derived platforms of UNIX such as Linux , Android , BSD , AIX , HP-UX , IRIX , Solaris , OS / 400 , LynxOS and QNX .

Because of its age, Tcl exists in earlier versions that are less common for operating systems such as VMS , OS / 2 , Ultrix, SCO OpenServer , OS-9 , Unicos.


The installation of Tcl can be done by compiling the source codes on the target platform. However, there are binary distributions which have the advantage of offering in addition to the language of the precompiled extensions.

ActiveTcl 5
ActiveTcl is the most complete distribution of Tcl / Tk. It is offered by Activestate and comes with many precompiled extensions and libraries. There are versions for Windows, Mac OS X, Linux, Solaris, AIX and HP-UX.
WinTclTk 6
WinTclTk is a distribution of Tcl-Tk only for Windows with precompiled extensions (including some Windows-specific), libraries and utilities.
ETcl 7
ETcl is a French distribution that takes the form of a single executable. It is designed especially for PDAs and mobile devices (Windows CE / Pocket PC / Windows Mobile / Android ). However, it also works on Windows, Mac OS X and Linux platforms. ETcl is very compact and includes, in addition to Tcl-Tk, extensions such as SQLite or a standalone C compiler on the fly.
Wize 8
Wize (Wish Integrated Zip Executable) is a distribution that drives from an integrated development environment and incorporates a file system based on ZIP format . It has SQLite , a bytecode compiler , sound management, 3D graphics and non-rectangular windows. There are versions for Windows and Linux.

Most Linux distributions by default offer a basic Tcl-Tk installation, and sometimes the extensions that go with it. To realize the presence of Tcl for Linux, simply type in the command line tclsh. Except in the case of specific implementations Tcl is always distributed with Tk, thus forming the language Tcl-Tk.

Specific Implementations

Jacl 9
Jacl is an implementation of Tcl written entirely in Java which allows to embed a script language in a Java application.
Jim 10
Jim is an implementation of Tcl that includes a subset of commands from the official version of Tcl plus specific features like dictionary, fence, anonymous (lambda) functions. This interpreter holds in only 85KB.
Tcljs 11
Tcljs is an implementation of Tcl written entirely in JavaScript which allows to embed Tcl in a compatible browser.
Hecl 12
Hecl is a script language whose syntax is derived from Tcl. It is intended for mobile phones that support a J2ME- compatible Java platform .
NaTcl 13
NaTcl is an implementation of Tcl to run Tcl scripts in the Google Chrome browser or in programs that are compatible with Native Client (NaCl) technology . It allows to develop Web applications with Tcl and also to access and manipulate the DOM content of Chrome.

Standard library

Tcl has a standard library called Tcllib  [ archive ] (the counterpart for Tk being the Tklib) written exclusively in Tcl. It contains 37 utility modules covering a wide range of domains: communication protocols, encryption , file management, data structures, numerical and mathematical computing, grammar, terminals, automatic documentation and text utilities.


# Operator sum
namespace import :: tcl :: mathop :: *
puts [ + 1 2 3 4 5 6 7 8 9 10 ]
# Maximum
namespace import :: tcl :: mathfunc :: max
 max 4 2 3 7 5 6 - 42
Encryption RC4 namespace import :: tcl :: rc4 :: *
set crypt [ rc4 - key Secret "Hello, World!" ]

Internet and networks

Tcl Plugin and tclets

The Tcl Plugin is a plugin that allows you to run tclones ( Tcl-Tk-based applets ) in a web browser. The latter interprets a Tcl-Tk application in a secure environment called Safe-Tcl  [ archive ], which guarantees the integrity of the host application (the browser in this case).

Web servers

Like most scripting languages, Tcl is intended to be executed from an HTTP server .


Tclhttpd is a lightweight web server written only in Tcl. It has the advantage of being scalable and cross-platform. It can be used as the basis for writing an application server or it can be embedded to manage, for example, an on-line help system or a search engine on CD-ROM.

Apache, mod_tcl, Rivet and Websh

Several options are available from the Apache HTTP server . First of all, the module mod_tcl  [ archive ] is used to embed a Tcl interpreter. And then the Rivet  [ archive ] and Websh  [ archive ] modules that are more elaborate with support for database management and template systems.


AOLserver is an open source web server developed by the company AOL which has a Tcl interpreter. It is multithreaded , extensible, usable on a large scale and manages static and dynamic web pages . It integrates a complete support of the databases.

Content Management System

The most widely known content management system based on Tcl is OpenACS ( Open Architecture Community System ). It relies on the AOLserver web server and supports the Oracle and PostgreSQL databases . OpenACS is used to design collaborative websites, ecommerce sites, ERP or e-learning systems ( e-learning ) or as .LRN dotFolio.


Expect is a tool based on Tcl-Tk to automate interactive applications such as telnet , ftp fsck , rlogin , rsh or ssh , or to automate tests. It is used, for example, for system administration.

Organization and Community aspects

Development of Tcl-Tk

The development of Tcl-Tk is provided by many people who contribute in the form of new features, patches, bug reports or documentation. To unite this development effort, the TCT (Tcl Core Team) was created in 2000.

The TCT consists of a panel of 12 experts, of which John Ousterhout is no longer a member. Its activity is coordinated through TIPs ( Tcl improvement proposals ). The TIP is a document that describes a project to improve Tcl. Anyone can write a TIP and submit it to the TST for discussion and approval during a vote.

A site brings together all the TIPs and provides information on their progress.

As far as the operational part is concerned, the collaborative development of Tcl-Tk is hosted on a specific site with the decentralized version management software Fossil .

Compared to other scripting languages, the publication timing of important versions of Tcl-Tk is not annual. The focus is on stability. There is also backwards compatibility for all versions of branch 8.x.

Community Resources

The activity of exchange and communication between users focuses mainly on the wiki and the discussion group. The most active wikis are the anglophone and francophone wiki. The same is true for newsgroups on Usenet with comp.lang.tcl and fr.comp.lang.tcl. A permanent chat is organized in English.

Added to this is the official Tcl-Tk website and the German, Russian, Chinese, Korean and Japanese portals.

An annual conference is held in the United States where the use of Tcl-Tk in industry is presented by various stakeholders. It is also an opportunity to take stock of the roadmap of language. In the same year, a European conference (EuroTcl) is held in Germany or France on the same principle.

User groups exist in the United States, Canada, Germany, the Netherlands, Denmark, England and Korea.

History of Tcl-Tk

The idea of ​​Tcl came to John K. Ousterhout ‘s work on software tools for designing integrated circuits at the University of California at Berkeley in the early 1980s. John Ousterhout and his students had developed Some interactive tools. They all had a different command language, which eventually complicated the sequencing of tasks.

In 1987, taking advantage of a sabbatical leave at the Research Laboratory of Digital Equipment Corp., John Ousterhout decided to harmonize the different command languages ​​by creating a unique language to control the applications. This is how Tcl (Tool Command Language) was born with a syntax influenced by the languages C , Lisp , Shell and Awk . The first tests were carried out on a DEC 3100 station and a SUN-3/75 station. Tcl then represented 7000 lines of code in C, half of which were comments. It only worked on UNIX systems .

The primary objectives of this interpreted language were:

  • Easy to learn and generic
  • Expandable
  • Can be embedded or link with applications

Tcl began to be distributed at an industrial conference at the University of Berkeley in 1989. In March 1990, John Ousterhout presented an article on Tcl at the USENIX Conference . As a result of numerous requests, he freely made available the sources of Tcl2.1 on the FTP server of the university. These were soon copied to other FTP servers around the world. Among the attendees of the conference was a Don Libes of NIST (National Institute of Standards and Technology). He was studying an application to automate tasks on UNIX and his work was not progressing fast enough. He understood at once that Tcl was a solution. From Tcl, in three weeks, He wrote Expect , a tool for automating interactive applications. Expect was the first application written in Tcl to be widely distributed, benefiting from great credit from system administrators.

At the same time, John Ousterhout began working on Tk as an extension to design graphical interfaces with Tcl at the end of 1988. In January 1991 he presented Tcl-Tk at the USENIX Conference and Conference X. Tcl-Tk’s popularity as a scripting language continued to grow. Mainly for two reasons:

  • Its ability to be embedded in an application while creating its own commands
  • The ease with which graphical interfaces could be developed (5 to 10 times faster than with Motif )

This second point was of great interest to industrialists.

A community federated around language and many extensions began to emerge (including TclX, Incr Tcl , BLT, Sybtcl, Oratcl, TclDP). The need to communicate more was felt so much that John Ousterhout initiated a discussion list. But the growing number of users prompted the creation of the comp.lang.tcl newsgroup.

In 1992 John Ousterhout co-founded, with Larry Rowe a colleague of the University of Berkeley, Perspecta Software, in order to market Perspecta Presents , a Unix-based presentation software based on Tcl-Tk. In 1993 Larry Rowe organized the first annual Tcl-Tk conference in Berkeley. Subsequently these conferences coincided with the release of the new versions of the language. A session was dedicated to the discussion on the addition of new features and the decision was made not without humor by an approximate freehand vote known as Ouster-vote.

In May 1994, John Ousterhout left the University of Berkeley for the industry following a proposal by Sun Microsystems to make Tcl-Tk a universal scripting language for the Internet. John Ousterhout saw this as an opportunity to ensure long-term language sustainability through this professional reorientation and team building (SunScript) within the Sun Microsystems Laboratories. The terms of the contract with Sun Microsystems clearly specified that Tcl-Tk source codes should remain freely accessible. Others did not see things in the same way. Thus, on September 23, 1994, Richard Stallman posed on comp.lang.tcla message entitled Why You Should not Use Tcl where he explained that Tcl n ‘ Was not a true programming language. From this inflamed discussion arises 1 month later the language Guile which was meant to be an alternative to Tcl. In retrospect, no one has yet fully understood what Richard Stallman’s real motives were for such an attack. This episode is known as Tcl War .

Meanwhile, at the Sun Microsystems lab, Scott Stanton, Ray Johnson and Jacob Levy improved Tcl-Tk’s input / output management system, added socket support, and most importantly wrote a version for Windows and Macintosh . This made Tcl-Tk a generalist and cross-platform scripting language in April 1996 with Tcl7.5 / Tk4.1. Other improvements included: a bytecode compiler (which increased the speed by a factor of 10), support namespacenamespaces ( ) and a Tcl plugin that allowed to execute tclerts (applets written in Tcl) In a Web browser. All these innovations corresponded to the version of Tcl-Tk 8.0 released in August 1997 when the decision was made to align the version numbers of Tk with those of Tcl.

October 1997 saw the creation of the Tcl Consortium, whose objective was to promote Tcl-Tk and further increase its visibility in the IT market. The consortium was funded by Sun Microsystems and headed by Peter H. Salus (former executive director of the USENIX Association and Sun User Group, but also vice president of the Free Software Foundation). Apart from John Ousterhout, the advisory committee included Brian W. Kernighan (co-creator of Awk ).

During these years, Tcl-Tk was heavily involved in mobile agent technology .

At the end of 1997, John Ousterhout left Sun Microsystems to co-found Scriptics after his employer decided to cancel the marketing projects for language-specific development tools. Scriptics took over by offering services around Tcl-Tk and by marketing the TclPro suite of tools. The development and maintenance of Tcl-Tk was then transferred to Scriptics with part of the Sun Microsystems Tcl-Tk team. The scripting languages ​​were then in full swing.

In the spring of 1998, Tcl-Tk received two awards. First of all the price of the ACM Software System which rewards the software which had a lasting influence and then the price STUG (USENIX Software Tools User Group).

In August 1998, at a conference on open source and business models in San Jose, California, Richard Stallman rose to the rostrum and took the microphone to declare that John Ousterhout was a “parasite” of the free software movement.

In April 1999 the Tcl-Tk version 8.1 was released. It incorporated a new regular expression engine (that of Henry Spencer ) and Unicode support. Exit too hastily, this version proved unstable. So much so that version 8.2 came out 3 months later to correct the imperfections.

In May 2000, Scriptics changed its name to Ajuba Solutions, moving more towards Tcl-based server solutions and XML technology , which was in full development at that time.

In October 2000, it was acquired by Interwoven. Few interested in free software, this one allowed the passage in opensource of the TclPro suite (whose single license was worth 1000 dollars). The case of maintenance and development of Tcl-Tk had already been anticipated with the creation in August 2000 of the TCT (Tcl Core Team) a group made up of a college of experts independent of any commercial structure. It was at this time that John Ousterhout (also a member of the TCT) decided to stop serving as a volunteer dictator and turned to the management and planning of IT projects.

In February 2000, the version of Tcl-Tk 8.3 was released, which had already been developed by Scriptics. The real effectiveness of the TCT could only be expressed with the release of Tcl-Tk 8.4 in September 2002 with, among other things, a thorough study of the internal mechanisms of the language and the addition of a virtual file system. After four years of development, released in December 2007 Tcl-Tk 8.5. This version brings many changes for Tcl-Tk by going towards functional programming.

In January 2008 Tcl is among the eleven certified open source projects certified by the US Department of Homeland Security (DHS) to conduct a study on application security. In March 2008, the development of the 8.6 branch began with two main axes: the inclusion of object-oriented programming in the kernel and making Tcl stackless (ie minimizing the use of the C language stack ). On December 20, 2012 release version 8.6 of Tcl-Tk. In addition to being equipped with an object system, it supports terminal recursion , coroutines , continuation and concurrent programming .

History of significant releases

Version Release date Latest news
  • Object system in the kernel
  • Tcl becomes stackless
  • Coroutines and terminal recursion (commands coroutine, yield, tailcall)
  • Managing exceptions (commands try,trap,finally)
  • Common interface for SQL databases ( tdbc::*)
  • Compatibility with IPv6
  • Virtual channels (command chan push/pop)
  • Extending List Management Commands (Command lmap)
  • Dictionary Filtering
  • Zlib compression in the kernel
  • Anonymous functions (command apply)
  • Expanding arguments (command {*})
  • Specific control ( chan) to manipulate channels
  • Dictionary (command dict)
  • Extending the order exprwith new mathematical operators
  • Extending List Management Commands
  • Rebuilding the date and time management command
  • Improved runtime speed by 10% compared to previous version
  • Virtual File System and Starkit
  • Enhanced serial port support (multiplatform)
  • Extending List Management Commands
  • Statistics for distributing data in a hash table
  • Improved execution speed by 25% compared to previous version
  • Extending globalizing pattern control ( glob)
  • Extending List Management Commands
  • New subcommands to function string
  • New package http
  • Implementation of the Tcl Extension Architecture (TEA)
  • Unicode support
  • Extending the regular expression engine
  • DDE Package (Windows)
  • Compilation of the bytecode on the fly
  • Handling binary data
  • Copying data from one channel to another
  • Namespaces ( namespace)
  • Packages http and registers (Windows)
  • First version for Windows and MacOS
  • Creating multiple interpreters in a single application
  • Managing event loops
  • Support for packages and loading of external libraries
  • Sockets support
  • Manipulating the date and time
6.6 February 1993
  • Control structure elseif
  • First consumer version
  • Inter-Application Communication Mechanism

Basic Commands

  • After
  • Append
  • Apply
  • Array
  • Auto_execok
  • Auto_import
  • Auto_load
  • Auto_mkindex
  • Auto_mkindex_oldfilename
  • Auto_qualify
  • Auto_reset
  • Bgerror
  • Binary
  • break
  • Catch
  • CD
  • Chan
  • Clock
  • Close
  • Concat
  • keep on going
  • Coroutine
  • Dde *
  • Dict
  • Encoding
  • Eof
  • Error
  • Eval
  • Exec
  • Exit
  • Expr
  • Fblocked
  • Fconfigure
  • Fcopy
  • File
  • Fileevent
  • Finally
  • flush
  • For
  • Foreach
  • format
  • Gets
  • Glob
  • global
  • History
  • Http
  • If
  • Incr
  • Info
  • Interp
  • Join
  • Lappend
  • Lassign
  • Lindex
  • Linsert
  • List
  • Llength
  • Lmap
  • Load
  • Lrange
  • Lrepeat
  • Lreplace
  • Lreverse
  • Lsearch
  • Lset
  • Lsort
  • Mathfunc
  • Mathop
  • Memory
  • Msgcat
  • Namespace
  • Open
  • Package
  • Parray
  • PID
  • Pkg :: create
  • Pkg_mkIndex
  • Platform
  • Platform :: shell
  • Proc
  • Puts
  • Pwd
  • Re_syntax
  • Read
  • Refch
  • Regexp
  • Registry *
  • Regsub
  • Rename
  • Return
  • Scan
  • Seek
  • set
  • Socket
  • source
  • Split
  • string
  • Noun
  • Switch
  • Tailcall
  • Tcl_endOfWord
  • Tcl_findLibrary
  • Tcl_startOfNextWord
  • Tcl_startOfPreviousWord
  • Tcl_wordBreakAfter
  • Tcl_wordBreakBefore
  • Tcltest
  • Tclvars
  • Tell
  • Throw
  • Time
  • Tm
  • trace
  • Trap
  • Try
  • Unknown
  • Unload
  • a set
  • Update
  • Uplevel
  • Upvar
  • variable
  • Vwait
  • While
  • Yield
  • Yieldto
  • Zlib

(*): Specific to the Windows platform

Most Popular Extensions and Libraries


  • VTK : Data Visualization Library
  • Tcl3d: OpenGL support with Tcl
  • VRS: interactive 3D library
  • TkPath: extension SVG
  • PDF4Tcl: PDF extension
  • QuicktimeTcl: QuickTime extension

His :

  • Snack: sound processing tool box
  • CSound: Virtual Instruments and Sound Processing

Internet and networks:

  • TclSOAP]: SOAP protocol and XML-RPC
  • Scotty]: SNMP protocol
  • MIB Smithy SDK]: SNMP protocol
  • Tclcurl: extension cURL

Database Management System:

  • OraTcl]: Oracle
  • SQLite]: SQLite
  • Mk4Tcl]: Metakit
  • PgTcl]: PostgreSQL
  • PgTclng]: PostgreSQL
  • MySQLTcl]: MySQL
  • SnODBC: ODBC interface

Specific to Windows:

  • Tcom: COM API
  • TWAPI: Win32 API
  • LPTTCL: parallel port


  • TclXML: XML , DOM and XSLT
  • Critcl: compilation of C code on the fly)

Products that use Tcl-Tk

  • AC3D  (en)
  • AMSN
  • GiD
  • Gridgen
  • Kadviser
  • Maxima
  • NS2
  • Open CASCADE
  • R
  • RenderMan
  • Scilab
  • TiVo
  • VTK
  • Cisco IOS
  • ETktab

Notes and references

  1. ↑ ( en ) « Latest Release: Tcl / Tk 8.6.6 (Jul 27, 2016) »  [ Archive ]
  2. ↑ See infra § Community resources
  3. ↑ Starkit  [ archive ]
  4. ↑ Starpack  [ archive ]
  5. ↑ ActiveTcl  [ archive ]
  6. ↑ WinTclTk  [ archive ]
  7. ↑  [ archive ] eTcl]
  8. ↑ Wize  [ archive ]
  9. ↑ Jacl  [ archive ]
  10. ↑ Jim  [ archive ]
  11. ↑ Tcljs  [ archive ]
  12. ↑ Hecl  [ archive ]
  13. ↑ NaTcl  [ archive ]