Updated 2014-07-27 20:09:35 by LarrySmith

Do you want a particularly small version of Tcl to embed in a hardware-constrained device? You're not the first. Here are a few possibilities:

Jim is a small footprint implementation of the Tcl programming language (full binary is around 70kb but can be reduced further), it's not based on an old version of Tcl, but was developed from scratch. Already includes features of Tcl 8.5 like dicts, {*}, as well as new extensions currently not present in Tcl 8.5, like closures, lambda with garbage collection, and the ability to build arbitrary linked data structures.

Jim is in active development as of Oct 2010

Karl Lehenbauer has implemented a ROMable "Tiny Tcl" [1] based on 6.8, to be particularly small.

2001-05-07: Tiny Tcl 6.8 is a rommable, minimal Tcl for embedded applications.

Derived from the venerable Tcl 6.7 release, Tiny Tcl 6.8 has a solid Tcl feature set, excluding newer capabilities of Tcl 7 and 8 such as the bytecode compiler, namespaces, sockets, and async event handling, among others. (Still, major applications have been written in Tcl 6.)

Excluding C library functions, Tiny Tcl compiles down to less than 60 Kbytes on most machines, far smaller than any Tcl 7 or Tcl 8 derivatives. On an embedded DOS system with 640K of RAM, programs of up to several thousand lines of code can be executed.


An updated version of TinyTcl is included in the uClinux distribution [2]

TinyTcl is not actively developed since Apr 2001

Jean-Claude Wippler re-implemented most of a modern (7.6-like?) Tcl in a particularly compact C++ coding he calls TinyTcl [3].

TinyTcl is not actively developed since Jan 1999

Larry Smith wrote "Cricket" [4] as a "tiny little interpreter" reminiscent of Tcl - It uses [ and ] for command dispatch as in Tcl, and ( and ) for "second argument dispatch" - allowing one to code, for example (a := $b). The ctools package [5] includes "Tinker", a tiny tcl interpreter without (). (these links are dead, sadly) He and RS co-authored the "Lightweight Object System for Tcl" LOST and MOST which uses Tequila for distributed LOST objects, which is small, but on top of regular Tcl's.

While John Ousterhout originally created Tcl as exactly an embeddable extension language [include some history here], it's grown into a general-purpose programming language. That growth has, of course, increased its demands on memory and the C run-time library. Key transitions along the way include ... the introduction of socket (7.5 or 7.6) ... the new object system (8.0), and Unicode (8.1-8.3). Versions such as 6.7, 7.2, 7.3, and 7.4 are popular among those content with a minimalistic Tcl. More on these transitions is available in a page called "Advantages and disadvantages of different Tcl versions".

There are many other less well-known languages especially targeted for embedding. Lua [6] is probably the most prominent of these (and a subject of several experiments by JCW, for example). Another that interests CL is Ficl [7]. All such languages generally fit in under 100K--quite a bit smaller than recent Tcl.

Donal Fellows and others have thought about this opportunity in terms of MicroTcl for Tcl9. A "modularized Tcl" is a goal that's inspired several project starts, none of which are particularly accessible in 2001. Tcl9 might still turn out to be a modularized Tcl, that is, one for which compile-time code and functionality choices are reasonably easy.

[Palm Tcl]

John Hall's port of 7.4 to PalmOS [8] (bad link) is still another instance of a "small Tcl".

Try http://rivendell.sourcefubar.net/ for John Hall's code.

Marshall T. Rose also had intentions of porting Tcl to PalmOS, but was able to devote little time to the project.

[Ashok Nadkarni] has written Palm TCL at http://home.earthlink.net/~ashoknadkarni/ (now moved to http://palm-tcl.sf.net/ ) ; based on Tcl 7.6, it provides support for many Palm widgets and rudimentary support for the Palm databases.

See also MicroTcl for Tcl9 and Tcl-To-Go.

ETLinux [9] is a small-footprint LINUX (2MB RAM, 2 MB disk) for embedded systems with a small Tcl interpreter built in.

aku (and tclguy) are working on Modular Tcl, specifically to fulfill an IOS-related contract with Cisco.

MicroTcl is part of the Nebula Device [10]. This is a stripped down Tcl8.4 version with 36 core Tcl commands only. No file io, networking, background jobs, event handling etc. It does not need any external runtime environment files. It can be linked statically into the application and has a code size of about 160KB.

Tcl's close cousin, Hecl, fits into a .jar file of less than 64K, including persistent storage, an 'lcdui' gui, and an http command.

See also: The Very Minimal Tcl Core Command Set

Picol - Tcl in Javascript

NanoCL [11]


Does gromtcl belong here? I thought it was standard Tcl embedded in a web server? LV If the documentation at the URLs listed on the gromtcl page are accurate, then you are right - gromtcl's install file says to get a standard tcl distribution and build and test it as the first step ...

Beware: (Not sure this belongs here) Has anyone attempted a port to the Nintendo DS? There are many Homebrew resources out there

Does Tcl still fit on 16-bit microcontrollers?