Est. 1993 Intermediate

[incr Tcl] (ITCL Shell)

The object-oriented extension that brought classes, inheritance, and encapsulation to Tcl - with its own itclsh interpreter and a name that puns on C++.

Created by Michael McLennan

Paradigm Multi-paradigm: Object-Oriented, Procedural, Event-driven
Typing Dynamic, String-based
First Appeared 1993
Latest Version Itcl 4.3.7 (2025)

[incr Tcl] (commonly written itcl, and run through its own itclsh interpreter) is a set of object-oriented extensions for the Tcl scripting language. Created by Michael McLennan and first shown publicly in 1993, it added classes, inheritance, encapsulation, and namespaces to a language that originally had none of those concepts. Its name is a play on C++: just as ++ increments a variable in C, [incr Tcl] “increments” Tcl using Tcl’s own incr command.

History & Origins

By the early 1990s, Tcl had become a popular embeddable command language, but it lacked any structured way to organize large programs. Procedures and global variables worked for small scripts, yet sizeable Tcl/Tk applications quickly became hard to manage.

Michael McLennan designed [incr Tcl] to fill that gap, drawing on the class model popularized by C++. The extension was first presented to a wide audience at the 1993 Tcl/Tk Workshop, the first conference dedicated to the language. McLennan worked within the AT&T Bell Laboratories / Lucent Technologies lineage that surrounded much early Tcl development, and the package was released under a BSD-style license that kept it freely usable and embeddable.

[incr Tcl] arrived at a moment when object orientation was sweeping through mainstream programming. It gave the Tcl community a familiar, industrial-strength way to write modular code without abandoning Tcl’s string-everything simplicity.

Design Philosophy

[incr Tcl] is deliberately conservative: it extends Tcl rather than replacing it. Everything you know about Tcl - commands, substitution, {braces}, the event loop - still applies. The extension layers a class system on top.

Its guiding ideas include:

  1. Classes as command namespaces - a class groups methods (procedures) and variables, and each object is itself a command.
  2. C++-style structure - class, constructor, destructor, method, public/protected/private, and inheritance feel familiar to C++ programmers.
  3. Encapsulation - object variables are protected from accidental global access, a major improvement over plain Tcl.
  4. Composition and inheritance - including multiple inheritance and object composition.
  5. C integration - like Tcl itself, [incr Tcl] supports binding class methods to C code.

Key Features

A minimal [incr Tcl] class looks much like a stripped-down C++ class expressed in Tcl syntax:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
package require Itcl

itcl::class Counter {
    private variable count 0

    constructor {} {}

    method increment {} {
        incr count
    }

    method value {} {
        return $count
    }
}

Counter c
c increment
c increment
puts "count = [c value]"   ;# count = 2

Notable capabilities include:

  • Classes and objects - declared with itcl::class; objects are created by calling the class like a command.
  • Constructors and destructors - lifecycle hooks for setup and cleanup.
  • Access control - public, protected, and private members.
  • Inheritance - single and multiple inheritance, with virtual method dispatch for polymorphism.
  • Namespaces - hierarchical scoping that influenced Tcl’s own namespace facilities.
  • The itcl::body separation - method bodies can be defined apart from the class declaration, useful for large programs.

The itclsh shell

[incr Tcl] ships in two forms. As a loadable package, any Tcl program can package require Itcl to gain the class system. As a standalone language, it provides its own interpreters:

InterpreterRole
itclshA tclsh-style command shell with [incr Tcl] preloaded
itkwishA wish-style GUI shell with [incr Tcl] and [incr Tk] preloaded

itclsh is the namesake “ITCL Shell” - it behaves exactly like the standard Tcl shell but makes the itcl::class and related commands available out of the box, so object-oriented scripts run without an explicit package require.

The Itcl Family

[incr Tcl] anchors a small family of related extensions:

  • [incr Tcl] (itcl) - the core object system.
  • [incr Tk] (itk) - a framework for building composite megawidgets using [incr Tcl] classes on top of Tk.
  • [incr Widgets] (iwidgets) - a ready-made library of megawidgets (dialogs, comboboxes, scrolled frames, notebooks) built with [incr Tk].

Together these gave Tcl/Tk developers a complete object-oriented application stack during the toolkit’s peak popularity.

Evolution

[incr Tcl] tracked Tcl’s own development closely:

  • 2.x (mid-1990s) - distributed alongside Tcl 7.5 / Tk 4.1; the megawidget frameworks took shape.
  • 3.x (late 1990s onward) - the long-lived series most associated with classic Tcl/Tk applications, refining namespaces and the standalone interpreters.
  • itcl-ng / 4.x - starting in the mid-to-late 2000s, the extension was re-implemented on top of TclOO, the object system that became part of the Tcl core in Tcl 8.6 (2012). Itcl 4.0 was bundled with the Tcl 8.6 source tree, and the 4.x series has continued with periodic bug-fix releases - Itcl 4.1.1 in late 2017 and, more recently, Itcl 4.3.7 shipped alongside Tcl 9 in 2025.

The arrival of TclOO in the core was itself shaped by years of experience with [incr Tcl] and other Tcl object systems, making itcl an important influence on modern Tcl.

Current Relevance

[incr Tcl] remains usable and is still shipped with many Tcl distributions, but its role has narrowed. In 2024, Terma - a long-time corporate Tcl user - publicly flagged Itcl, Itk, and Iwidgets as deprecated - noting they are not thread-safe and, according to that announcement, have seen little active development over the past decade - and recommended TclOO for new object-oriented Tcl code.

That said, a great deal of existing software still depends on it. Legacy Tcl/Tk applications, engineering tools, and scripts written against the [incr Tcl] / [incr Widgets] stack continue to run on modern interpreters, which is exactly why the language is worth understanding today.

Why It Matters

[incr Tcl] mattered because it proved that a minimalist, string-oriented scripting language could host a full object model without losing its character. It gave thousands of Tcl/Tk developers the structuring tools they needed to build large applications, popularized hierarchical namespaces in the Tcl world, and ultimately informed the design of TclOO, the object system now baked into Tcl itself. For a generation of programmers, the itclsh prompt was where object-oriented Tcl began.

Timeline

1993
Michael McLennan develops [incr Tcl]; first presented publicly at the inaugural Tcl/Tk Workshop
1996
Itcl 2.x distributed alongside Tcl 7.5 / Tk 4.1, around the time the [incr Tk] and [incr Widgets] megawidget frameworks matured
1998
Itcl 3.x series released, refining namespaces, class scoping, and the standalone itclsh / itkwish interpreters (approximate date)
2007
The itcl-ng effort (begun around 2006-2007) starts re-implementing Itcl on top of Tcl's emerging TclOO object core
2012
Itcl 4.0, rebuilt on TclOO, bundled with the Tcl 8.6 source distribution
2017
Itcl 4.1.1 released in mid-December, continuing the TclOO-based 4.x series
2024
Terma, a long-time corporate Tcl user, publicly flags Itcl, Itk, and Iwidgets as deprecated and not thread-safe, recommending TclOO for new object-oriented code

Notable Uses & Legacy

[incr Widgets] (Iwidgets)

A large library of reusable Tk megawidgets - dialogs, notebooks, scrolled panes - built entirely on [incr Tcl] classes and [incr Tk].

EDA and CAD Tooling

Electronic design automation and CAD applications in the Tcl ecosystem used [incr Tcl] to structure large scripting layers and custom GUI components.

Tcl/Tk Desktop Applications

Many 1990s and 2000s Tk desktop tools adopted [incr Tcl] to organize their widget and dialog code into reusable, inheritable classes.

Scientific and Engineering GUIs

Visualization and instrument-control front ends written in Tcl/Tk leaned on [incr Tcl] for object-oriented modeling of devices and views.

Language Influence

Influenced By

Influenced

TclOO

Running Today

Run examples using the official Docker image:

docker pull
Last updated: