Est. 1999 Intermediate

XOTcl

Extended OTcl - a dynamic object system for Tcl from Gustaf Neumann and Uwe Zdun, first described in 1999, that gave scripting per-object mixins, filters and runtime-mutable classes, helped inspire Tcl 8.6's built-in TclOO, and still ships as XOTcl 2 inside the Next Scripting Framework

Created by Gustaf Neumann and Uwe Zdun

Paradigm Object-Oriented (dynamic, class-based with metaclasses, mixins and filters), on top of imperative Tcl
Typing Dynamic; as in Tcl, every value can be treated as a string
First Appeared 1999
Latest Version XOTcl 1.6.8 (April 2014) for the standalone line; XOTcl 2 ships in Next Scripting Framework 2.4.0 (August 2022), with 2.5.0 prepared (untagged) in summer 2026

XOTcl (Extended OTcl, which its authors pronounced “exotickle”) is an object-oriented extension of the Tcl scripting language. Gustaf Neumann and Uwe Zdun built it on top of MIT’s OTcl and first described it in 1999. Most object systems of the time only allowed classes and methods to be defined up front. In XOTcl, nearly everything could change while a program ran: which class an object belonged to, which classes were mixed into one object, and which methods sat in front of every call. The authors’ stated goal was language support for design patterns, so that a pattern could live in one place in the code instead of being spread across several classes.

XOTcl matters beyond its own user base. When the Tcl core team designed a built-in object system for Tcl 8.6, their proposal said it was “semantically inspired by XOTcl”. The language also still runs production software: the OpenACS web framework is built on it, and XOTcl 2 is maintained today inside the Next Scripting Framework.

History and origins

From OTcl to XOTcl

OTcl (“MIT Object Tcl”) was written by David Wetherall for the VuSystem project at MIT. It was a compact, dynamic object system that its maintainers said drew on CLOS, Smalltalk and Self, and later it was best known as the scripting layer of the ns network simulator. OTcl already let classes and objects be created, changed and destroyed at runtime, which is why Neumann and Zdun chose it as their starting point.

In May 1999, both authors were at the University of Essen, in Germany, when they presented XOTcl at the 5th USENIX Conference on Object-Oriented Technologies and Systems (COOTS ‘99) in San Diego. Their paper introduced filters, methods that intercept messages sent to an object, as a way to express design patterns. That summer, a second paper at the Nordic Workshop on Software Architecture described per-object mixins. By October 1999, the Essen homepage offered XOTcl 0.76 as a “preliminary version for evaluation”, available only as source code.

In February 2000, at the 7th USENIX Tcl/Tk Conference in Austin, the paper XOTcl - an Object-Oriented Scripting Language presented the full design. By then, Neumann was at the Vienna University of Economics and Business Administration (WU Wien), where the project has been based ever since.

Growing up

The 0.8x releases of 2000 added Windows and Linux binaries and a set of web components called ActiWeb. Version 1.0 was released on 8 November 2002. The 1.x line continued for over a decade, with 1.3 in 2004, 1.5 in 2006 and 1.6 in 2008, and ended with 1.6.8 in April 2014. Uwe Zdun’s name appears in the copyright notice for 1999 to 2007. Martin Matuska contributed during 2007 and 2008, and Stefan Sobernig has co-maintained the code since 2010.

Design philosophy

XOTcl follows Tcl’s own principles: everything is a command, everything can be inspected, and everything can be redefined. It applies them to objects.

  • Classes are objects too. A class is an instance of a metaclass and can receive messages, be modified and be introspected like any other object.
  • Everything is dynamic. Methods can be added or removed at any time, a class can gain or lose superclasses, and an existing object can change its class.
  • Composition happens at runtime. Mixins and filters can be attached to a single object or to a whole class, and removed again later.
  • Objects can describe themselves. The info method reports an object’s class, mixins, filters, variables and methods.

Key features

Classes, methods and next

Methods are defined with instproc, and next calls the same-named method further along the method resolution order. The COOTS paper says next was “modeled after CLOS”. In this example, an existing object changes its class while the program runs:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
package require XOTcl
namespace import ::xotcl::*

Class Animal
Animal instproc speak {} { return "..." }

Class Dog -superclass Animal
Dog instproc speak {} { return "Woof, then [next]" }

Animal pet
puts [pet speak]          ;# ...
pet class Dog             ;# change the class of a live object
puts [pet speak]          ;# Woof, then ...
puts [pet info class]     ;# ::Dog

Per-object mixins

A mixin adds a class’s methods to an object, ahead of the object’s own class. A per-object mixin affects just one instance, so behaviour can be added to or removed from a single object without creating a subclass:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
Class Stack
Stack instproc init {} { my set things {} }
Stack instproc push {x} { my lappend things $x; return $x }
Stack instproc pop {} {
  my instvar things
  set top [lindex $things end]
  set things [lrange $things 0 end-1]
  return $top
}

Class Safety
Safety instproc pop {} {
  if {[llength [my set things]] == 0} { error "stack is empty" }
  next
}

Stack s
s mixin Safety            ;# only this stack gets the check

Filters

A filter is a method that runs before every message an object receives, and decides whether to pass the message on with next. It can be registered on a class (instfilter) or on a single object (filter). Filters make patterns such as tracing, access control or adapters possible without editing the methods they wrap:

1
2
3
4
5
6
Stack instproc logCall args {
  puts "-> [self calledproc] [self args]"
  next
}
Stack instfilter logCall
s push x

Run against NSF 2.4.0, this prints two lines, not one, because the filter also catches the lappend message that push sends to its own object:

1
2
-> push x
-> lappend things x

Assertions

XOTcl 1 added assertions for design by contract: pre- and post-conditions on methods and invariants on classes, which can be switched on for each object with check:

1
2
3
4
5
6
7
8
9
Class Account -parameter {{balance 100}}
Account instproc withdraw {amount} {
  my incr balance -$amount
} {{[my balance] > 0}} {{[my balance] >= 0}}

Account a
a check all
a withdraw 60     ;# balance is now 40
a withdraw 60     ;# assertion failed check: {[my balance] >= 0} in proc 'withdraw'

The original feature list also included nested classes, dynamic object aggregation through Tcl namespaces, and metadata for self-documenting code.

Evolution: XOTcl 2 and NX

At the end of the 2000s, Neumann and Sobernig split XOTcl into two layers. The lower layer is the Next Scripting Framework (NSF), a C library that provides the machinery for object systems: method dispatch, mixins, filters and argument checking. It can host several object systems in one Tcl interpreter. On top of it, the object systems themselves are written entirely in Tcl. NSF ships with:

  • XOTcl 2, which reproduces XOTcl 1 closely enough that, according to the project’s migration guide, most existing XOTcl 1 programs run without changes.
  • NX, the Next Scripting Language, which the project describes as a successor to XOTcl based on “10 years of experience with XOTcl in projects containing several hundred thousand lines of code”. NX uses more mainstream terms, has fewer predefined methods and puts more weight on explicit interfaces.
1
2
3
4
5
6
7
8
package require nx

nx::Class create Greeter {
  :property {name World}
  :public method greet {} { return "Hello, ${:name}!" }
}

puts [[Greeter new -name XOTcl] greet]   ;# Hello, XOTcl!

The first NSF beta was tagged in October 2011. The first stable release, 2.0.0, came in late 2014, followed by 2.1.0 (2016), 2.2.0 (2018), 2.3.0 (2019) and 2.4.0 (August 2022). NSF is released under the MIT license. A 2.5.0 release, which completes support for Tcl 9, was prepared in the summer of 2026 (version bump in July, draft announcement in August) but had not been tagged as of September 2026.

Influence on Tcl itself

For years Tcl had no built-in object system. Programmers instead chose among extensions such as [incr Tcl], OTcl, XOTcl, stooop and Snit. TIP 257, created in September 2005 by Donal Fellows and co-authors, proposed adding object-oriented support to the Tcl core that would be “semantically inspired by XOTcl”, and was designed so that other object systems could be built on top of it. The result, TclOO, was merged in 2008 and has shipped with every Tcl release since 8.6.0 (December 2012). TclOO’s mixins, filters and next-based method chaining closely resemble their XOTcl counterparts, reflecting that stated inspiration. A competing proposal from Neumann, TIP 279, suggested a minimal core for hosting multiple object systems. It was never adopted into Tcl, but its central idea became the basis of NSF.

Current relevance

Treat XOTcl as two things:

  • XOTcl 1, the standalone distribution, is dormant. Its last release was 1.6.8, in 2014.
  • XOTcl 2 is maintained. It is part of every NSF release, NSF was still receiving commits in September 2026, and Debian packages NSF 2.4.0. Its largest user community is OpenACS, whose xotcl-core and xowiki packages were still receiving commits in 2026.

Beyond OpenACS, XOTcl is a niche language. There is no official Docker image; the only one found is a small community image bundling NSF 2.4.0.

Why it matters

XOTcl showed that a scripting language’s object system could go well beyond classes and inheritance. It added per-object mixins, message filters and runtime class changes, and it made them practical tools rather than research topics. That work had two lasting effects. Through TIP 257 it helped shape the object system built into every copy of Tcl since 8.6. Through OpenACS and Learn@WU it has run large production web systems since at least the mid-2000s. And more than 27 years after the COOTS paper, Gustaf Neumann is still committing to the codebase that carries it.

Timeline

1999
Gustaf Neumann and Uwe Zdun present XOTcl at COOTS '99 in San Diego in May, in the paper "Filters as a Language Support for Design Patterns in Object-Oriented Scripting Languages". By October the University of Essen homepage offers version 0.76 as a source-only preview built on MIT's OTcl and Tcl 8.0.5
2000
The paper "XOTcl - an Object-Oriented Scripting Language" appears at the 7th USENIX Tcl/Tk Conference in Austin in February. Version 0.81, released 5 June, is the first with Windows and Linux binaries and bundles ActiWeb, a set of XOTcl web components (HTTP server, XML/RDF parser, persistent store, mobile objects)
2002
XOTcl 1.0 is released on 8 November, after the 0.8x and 0.9x preview series
2005
Neumann makes the first check-in of xotcl-core for OpenACS on 11 October, and xowiki follows in December. XOTcl becomes a core part of the OpenACS web framework. In September, TIP 257 proposes an object system for the Tcl core that is "semantically inspired by XOTcl"
2006
XOTcl 1.5.0 is released on 14 September. In October, Neumann files TIP 279, which proposes a minimal core object system able to host several object systems at once. The idea resurfaces in the Next Scripting Framework
2008
XOTcl 1.6.0 is released on 24 February. On 31 May, TclOO (TIP 257) is merged into the Tcl 8.6 development line; it ships in Tcl 8.6.0 on 20 December 2012
2011
The first beta of the Next Scripting Framework (NSF) is tagged on 14 October. NSF contains both XOTcl 2 and a new language, NX, and is presented at the 18th Annual Tcl/Tk Conference in Manassas, Virginia, that October
2014
XOTcl 1.6.8, released 29 April, is the last standalone XOTcl 1 release. NSF 2.0.0, the first stable release of NSF, NX and XOTcl 2, is tagged on 28 October and announced on 1 January 2015
2022
NSF 2.4.0, including XOTcl 2, is released on 14 August. It is the latest tagged release as of September 2026 and is the version packaged in Debian 13 (trixie)
2026
NSF 2.5.0, which completes Tcl 9 support, is version-bumped on 14 July, and a release-candidate announcement is completed on 21 August, marking more than 27 years since the COOTS '99 paper. According to that draft announcement, the release was introduced in a talk in Vienna at the 10th OpenACS conference and 22nd European Tcl/Tk Users Meeting in July

Notable Uses & Legacy

OpenACS

The xotcl-core package, first checked in by Gustaf Neumann in October 2005, provides the XOTcl layer that many OpenACS packages build on, including the xowiki content system. The openacs.org community wiki runs on xowiki, and both repositories still received commits in 2026

Learn@WU

The e-learning platform of the Vienna University of Economics and Business was launched in fall 2001 on OpenACS and dotLRN. Neumann and Peter Alberer's May 2005 slides state that most newly developed Learn@WU components were implemented in XOTcl, including the objects that give access to course community data

next-scripting.org

The Next Scripting Framework's own website runs on OpenACS and xowiki, and so on XOTcl-based code

ActiWeb

A set of web components in XOTcl distributed with the language from 2000: an HTTP/1.0 and 1.1 server and client (xoComm), an XML/RDF parser (xoXML/xoRDF), a persistent store (xoStore), and mobile and active web object systems (xoMOS, xoAWO)

XOTclIDE / TclSqueak

A Smalltalk-inspired integrated development environment for XOTcl and Tcl, with code browsing, introspection, debugging and version control. It tracked XOTcl 1.6 (version 0.83, 2008) and XOTcl 2.0 (0.85, 2012), and was renamed TclSqueak at version 0.90 in June 2015

Language Influence

Influenced By

OTcl Tcl CLOS

Influenced

TclOO NX

Running Today

Run examples using the official Docker image:

docker pull michaelfeurstein/simplynx:latest

Example usage:

docker run --rm -v $(pwd):/usr/local/scripts michaelfeurstein/simplynx:latest /usr/local/scripts/hello.tcl
Last updated: