Tcl Related Link
Switch branches/tags
Nothing to show
Clone or download
Latest commit 4f4d584 Sep 25, 2018
Failed to load latest commit information.
script Update May 30, 2018 Fix Github MD format changed Mar 22, 2017
LICENSE Initial commit Feb 22, 2016 Update Sep 19, 2018 Update Sep 4, 2018 Update Sep 25, 2018 Update Sep 25, 2018
tclIO-fev-100.png Update Apr 29, 2018


這是一個我個人收集的 Tcl 相關連結網頁。目的是我需要某個連結的時候,可以很快的找到。


Summary of Tcl language syntax

Tcl 說明文件中關於語法的說明,總共有 12 條規則。

Everything is a string

The more precise meaning of Everything is a string is every value is a string. This is one of the central features of Tcl.




And check Book.

Tcl Distributions


Binary for Windows


Editor and IDE

Useful info:

And TDK (Tcl Dev Kit) is open sourced by ActiveState, check

Version control

  • Fossil SCM - a distributed version control system, bug tracking system and wiki software server
  • Git and the Git repository browser gitk
  • TkCVS

Issue tracking



  • TclProDebug - Upgrade of debugger from classic TclPro to Tcl 8.5+
  • Tclgdb - Use gdb breakpoints for Tcl source with Tcl_CreateTrace
  • lttngtcl - LTTng trace provider which connects to Tcl_CreateTrace
  • ddt - Dynamic Debugging for Tcl

Code Analysis

info is a built-in command, provides information about the state of a Tcl interpreter. With info, you can find out about your Tcl environment.

  • TclParser - You can get it from TclProDebug, at lib/tclparser folder
  • Nagelfar - to read a Tcl program and provide static syntax analysis, and Nagelfar-Vim
  • tclchecker - a component of Tcl Dev Kit, is a fork of procheck, the static analysis tool.

And check Scripted Parsing.

Build System

  • BAWT - Tcl based configurable framework for automatically building C/C++ based software libraries from source code
  • kitgen build system - Framework to generate TclkitLite executables, compile Tcl packages and build kit files for different operating systems
  • KitCreator - a simple build system for creating a Tclkit

Package system

  • teapot - TEA Package Management system built by ActiveState
  • teaget - is a tcl only script that can be used as a command line utility to retrieve packages

However, ActiveTcl 8.6.6 does not include teaget this tool (when I test last time).

And you can check Debian packages for Tcl/Tk. I think most Linux distributions include some Tcl/Tk packages.

For example, you can install Tcl/TK at openSUSE:

sudo zypper install tcl tk

And below is Debian and Ubuntu:

sudo apt-get install tcl tk

Wrap tool

  • freeWrap: FreeWrap distributions are freely available for Linux and Windows operating systems.
  • tclexecomp
  • Thatch - Create standalone Tcl/Tk apps


  • tcltest - a package distributed with Tcl, provides a framework for writing and executing program tests.

Standard Libraries

Tcllib is a distribution of several packages for Tcl, all written entirely in Tcl, useful in a broad variety of areas. A tklib module also exists under the tcllib project, which contains modules that depend on Tk.

tcllibc is a term used to refer to the parts of Tcllib written in C. Some packages in Tcllib provide two implementations, one written in pure Tcl for compatibility and low installation overhead and one written in C for speed. You need Critcl if you want to build tclllibc.

Collection and Tool box

  • ToclBox - A ToolBox for Tcl
  • chiark-tcl - a collection of tcl extensions and bindings to useful libraries, include adns, tinycdb, parts of the nettle crypto library and more)
  • tcl-modules - A collection of Pure-Tcl Packages & Utilities
  • ycl - short for Yorick's Computing tooLkit, is PYK's collection of miscellaneous procedures and programs.
  • til - The Tcl ICE Library
  • tcl-hacks - A repository of useful and/or interesting hacks in Tcl
  • tclapps: a suite of small applications for Tcl useful as examples and in regular use to a large collection of Tcl programmers
  • Sugar - a macro system for the Tcl programming language, and Sugar macros collection
  • tcl-gen - General Utilities for Tcl
  • TCLtools - Сollection of TCL scripts for Cisco IOS penetration testing


TclOO is both a toolkit for creating object systems, and an object system in its own right. As of Tcl 8.6, is part of the core distribution.

Useful info:

Functional Programming

  • tcllib lambda - Utility commands for anonymous procedures
  • control::functional - Enhanced support for functional programming in Tcl, with implementations of some common higher-order functions
  • fptools - A grab bag of functions that can be useful for FP
  • tcl-f - Provides loadable Tcl extension for programming in functional manner
  • underscore-tcl - Functional programming utilities for Tcl

As with many things, Tcl is rather unique in this area. Commands themselves can not be passed as arguments to other commands, but their names can, which provides something very similar to first-class functions. Additionally, apply can be used to interpret a value as a function and evaluate it, providing the equivalent of lambda functions.


A Character-based User Interface is a user interface that features full-screen cursor manipulations to emulate forms, etc.

The abbreviation TUI (text-based user interface) is sometimes used to describe the same thing.

curses is perhaps the most widely-known CUI.


Tk is a graphical toolkit for Tcl. It allows you to develop graphical applications that run on Windows, Linux, MacOS X and many other platforms.

Tk is equally available as a windowing toolkit for Tcl, Ruby, Perl, Python. TkDocs has the best overview of how this compares.

  • Tk
  • Ttk - Implementation of the Tk theming engine to provide native look and feel widgets, now included in Tk 8.5

and check:

GUI toolkit

  • Gnocl: Tcl binding to GTK
  • TclFltk: a Tcl binding for the Fast Light Tool Kit portable GUI development environment

Graphics and Images

  • tkImg - Additional image formats
  • tksvg - An extension for Tk to read SVG images based on nanosvg
  • Imgtools - manipulate Tk photo images
  • CRIMP - C Raster Image Manipulation Package
  • PhotoResize - A single-purpose extension for Tcl to resize/resample photo images
  • - Feature-complete Tcl interface to GD graphics drawing library
  • tclepeg - provide a tcl extension to the epeg thumbnailing library
  • tclimage - A Tcl library extension for managing virtually any kind of images
  • tclmagick - Tcl and Tk Interfaces to GraphicsMagick and ImageMagick
  • pure-tcl BMP reader/writer
  • Pure Tcl JPEG decoder - A single-file pure Tcl baseline JPEG decoder library
  • tcllib exif - to extract and parse EXIF fields from digital images
  • tklib plotchart
  • ukaz - Graph widget in pure Tcl/Tk

For handle image formats, you can check tkImg. PNG is also built-in support in Tcl/Tk 8.6.0 (and above version).

Useful info:

For barcode:

  • tzint - tcl package for libzint barcode encoding library (no Tk needed)

And Barcode FAQs has valuable information.

And my project:

Audio and Sound

And volume control:

Now available on SourceForge.

Useful info:

And my projects:

  • tcllibao - Tcl bindings for libao
  • tpulsesimple - Tcl bindings for PulseAudio simple API
  • tclopenal - Tcl bindings for OpenAL (open audio library)
  • tclsndfile - Tcl bindings for libsndfile
  • tclopusfile - Tcl bindings for Opusfile library
  • tclmpg123 - Tcl bindings for libmpg123
  • tcltaglib - Tcl interface for taglib (Abstract API only)
  • tclmixer - source code is from SDL_mixer bindings for Tcl, try to link SDL2


Useful info:

And my project:

  • tkvlc - A demo to embed libVLC to Tk toolkit widget

Channel and file system

  • chan - a built-in Tcl command, manipulates channels
  • TclVfs
  • tcl-fuse - A Tcl interface to the linux kernel's FUSE subsystem
  • di Tcl extension - Filesystem Usage/Information. The di program now provides a Tcl extension starting with version 4.39
  • Memchan - In-memory channels for Tcl, and deprecated by tcllib's tcl::chan::memchan, which is available for Tcl >= 8.5.
  • Trf - is a Tcl extension based upon the principle of stacked channels. Stacked channels is available at the Tcl-script level (after 8.5). See the chan command for details.
  • trofs - Tcl Read-Only Filesystem
  • tserialport - tcl package for library libserialport
  • Add a time stamp to each line of output - a useful example of the transchan functionality available in Tcl

Command line

  • Tcllib cmdline Procedures to process command lines and options
  • getopt.tcl - A getopt implementation of tcl that compat with GNU getopt
  • tabulate - a command line utility that converts standard input into pretty-printed tables

And useful info:


And my project:


And useful info:

Distributed computation

Distributed Computation is a form of concurrent computing in which multiple programs, perhaps running on different processors, which may be remote, communicate to accomplish tasks.

And check Distributed computation.

Parallel computing



  • tcllib csv - a Tcllib package, provides facilities for working with csv files
  • tclcsv - for reading and writing CSV format files
  • speedbag - a package for providing accelerated C-based routines for TSV parsing into an array


Tcl Database Connectivity (TDBC), part of Tcl 8.6, is a common database access interface for Tcl scripts.

and check:

Data type

  • Tarray - implements a new Tcl collection data type - typed array
  • TclRal - Tcl Relational Algebra Library. It introduces tuple and relation data types and a set of commands that operate on them.
  • tclvalue - An extension for Tcl 8.6+ to reflect the Tcl_Obj API into the script level
  • AitCS - Array in the Command's Shadow
  • Persistent arrays

And check:

Data struct

list is a built-in Tcl command, creates a list.

dict is a built-in command for creating and manipulating dictionaries (dicts). A dict, or dictionary, is a list containing an even number of words.

array is a built-in ensemble of commands that manipulates Tcl's array variables. Array variables can also be manipulated using arrayName(key) syntax.

struct - Documentation can be found for various (tcllib) data structures.Provided structures, so far:

  • graph
  • list
  • matrix
  • pool
  • prioqueue
  • queue
  • record
  • set
  • skiplist
  • stack
  • tree
  • disjointset


  • DiffUtilTcl - A Tcl extension for diff utility functions, like Longest Common Substring
  • Eskil: A graphical view of file and directory differences
  • tkdiff - a graphical front end to the diff program

And check

Documentation Tools

  • doctools - a set of tools is included so that the tcllib author can write the documentation for his/her module in a format agnostic manner, and then convert the documentation into Unix man pages, HTML, and other formats.
  • Ruff! - generates reference documentation for Tcl programs using runtime introspection.


  • file - Manipulate file names and attributes
  • glob - Return names of files that match patterns
  • tcllib fileutils - Procedures implementing some file utilities
  • tmag - Tcl's libmagic interface


  • tcllib nmea - provides a standard interface for writing software which recieves NMEA standard input data
  • proj - swig based binding for tcl for the proj.4 library using the new API.
  • Shapetcl: Simple shapefile access for Tcl.

And useful info:

Internationalization and localization

  • msgcat - a built-in manages Tcl message catalogs for localising text
  • locale package - a locale command to work with Tcl



  • socket - a built-in Tcl command, opens a TCP network connection
  • Tcl UDP extension
  • tcl-pcap - Tcl extension that allows access to the libpcap library
  • scotty - A Tcl extension for building network management (SNMP, ICMP, UDP, DNS) applications
  • tclnetsnmp - netsnmp package for TCL 8.6
  • ecap-tcl - An eCAP adapter for Tcl
  • Netinfo - Protocol, service, network, host and ether info
  • Tcllib ldap - LDAP client
  • Sensus ldap
  • Tcllib ftp - Client-side tcl implementation of the ftp protocol
  • socketservertcl - Basic socketserver support in Tcl inspired by libancillary
  • tclcan - Tcl interface to Linux SocketCAN
  • UPnP - Universal Plug and Play
  • Duft - Datagrams and Udp For Tcl
  • Hosts - Command line tool and Tcl library for manipulating /etc/hosts

And useful info:

  • Modbus - a de facto standard communication protocol and is now a commonly available means of connecting industrial electronic devices
  • topcua - OPC Unified Architecture (OPC UA) is a machine to machine communication protocol for industrial automation developed by the OPC Foundation

Numeric processing

  • expr is a built-in Tcl command, evaluates an expression.
  • tcl::mathfunc - The ::tcl::mathfunc namespace provides commands for all the functions available in expr command.
  • Tcllib math - Tcl Math Library
  • LA - The Hume Linear Algebra Tcl Package
  • mathemaTcl - MathemaTcl is a collection of compiled extensions for Tcl, each intended to solve a particular numerical problem
  • Mpexpr - Mpexpr is a multiple precision math package for Tcl
  • tensor
  • VecTcl
  • Tcl-FFTW - Tcl wrapper around FFTW

And useful info:


Parser Engine

  • Marpa/Tcl - Marpa is a Tcl binding to libmarpa

Procedure Tools

  • parse_args - A fast argument parser based on the patterns established by core Tcl commands like [lsort], [lsearch], [glob], [regex], etc.
  • tclargp - allows simple and flexible using and parsing optional arguments, source code you can get from BAWT project
  • argparse - a feature-heavy argument parser

Text and string

  • encoding - a built-in command, manages the conversion of text to and from particular encodings
  • regexp - a built-in Tcl command, matches a regular expression in a string
  • regsub - a built-in Tcl command, performs substitutions based on regular expression pattern matching
  • tcllib textutil

And useful info:

And my project:

  • regex_rez - Tcl bindings for RE2, implement basic function - fullmatch, partialmatch, replace and globalrelpace
  • tcl-opencc - Tcl bindings for OpenCC (libopencc)


The clock command performs several operations that obtain and manipulate values that represent times.

This command time will call the Tcl interpreter count times to evaluate script (or once if count is not specified). It will then return a string of the form.

  • tclclockmod - Tcl clock extension: faster Tcl-module for the replacement of the standard "clock" ensemble of tcl

Web and Http

  • http - Client-side implementation of the HTTP/1.1 protocol
  • tclcurl - Tcl wrapper for Curl. Curl got HTTP/2 support when it's linked with the nghttp2 library in version 7.43.0.

And for html and CGI

  • Tcllib html - provides tools to generate HTML programmatically (tcllib module)
  • htmlparse - tcllib module
  • ncgi - provides commands that manipulate CGI values (tcllib module)
  • Tclgumbo - Tcl interface for gumbo library
  • tDOM 9.0 as build option an interface to the gumbo HTML5 parser, which also digests almost any other HTML. (--enable-html5)

And please check Web server and framework.


  • tclsass - Tcl interface to the libsass library


Templating language

CommonMark and Markdown

And you can check Markdown2Go.


  • mustache.tcl - A Tcl implementation of the mustache templating language


And my project:

  • tclxqilla - Tcl extension for XQilla library



Containers are a method of operating system virtualization that allow you to run an application and its dependencies in resource-isolated processes.




exec is a built-in Tcl command, executes other programs.

The ::tcl_platform is a global array holds useful data concerning the platform on which a specific Tcl interpreter is running.

And useful info:

Apple Macintosh


The proc filesystem (procfs) is a special filesystem in Unix-like operating systems that presents information about processes and other system information in a hierarchical file-like structure, providing a more convenient and standardized method for dynamically accessing process data held in the kernel than traditional tracing methods or direct access to kernel memory. You can check my test.

And useful info:



  • AndroWish: AndroWish allows to run desktop Tcl and Tk programs almost unaltered on the Android Platform while it opens the door to script a rich set of features on a mobile platform.


  • EmTcl: Tcl 8.6 and Jim Tcl in the browser through emscripten
  • Wacl - This is a Tcl distribution for WebAssembly. It enables Web developers to embed a Tcl interpreter in the browser and integrate Tcl with JavaScript.


  • FireTcl - It's a framework for developing desktop apps using web technology and Tcl, embeds Tcl inside a browser with websocket support
  • Tcl/Tk plugin
  • Wtk - A variant of the Tk toolkit for GUI development in JS, for use in Browsers


CSharp and dotNET

  • Tcl Interpreter in C# Application
  • Eagle: Eagle (Extensible Adaptable Generalized Logic Engine) is an implementation of the Tcl scripting language for the Common Language Runtime (CLR). Beta 42 release support for building against and running on the .NET Core 2.x runtime (which conforms to the .NET Standard 2.0) has been added.
  • Eagle Integration Tutorial
  • Garuda: is part of the Eagle project. It is a stubs-enabled native package for Tcl that allows the CLR and Eagle to be loaded and used by Tcl 8.4 or higher on Windows.

And my test for TickleSharp:

  • TickleSharp - Binding to the Tcl/Tk scripting language for the .NET platform


  • JTcl: JTcl is an implementation of Tool Command Language written in Java. JTcl implements a large extent of Tcl 8.4 syntax and commands, limited only by API restrictions of the Java Virtual Machine.
  • tclJBlend - a fork of TclBlend
  • Tcl/Java

and my TclBlend backup


  • ffidl and git repository - Foreign Function Interface
  • critcl - Critcl lets you easily embed C code in Tcl
  • SWIG - SWIG is a compiler that integrates C and C++ with languages including Perl, Python, Tcl, Ruby, PHP, Java, C#, D, Go, Lua, Octave, R, Scheme (Guile, MzScheme/Racket, CHICKEN), Scilab, Ocaml, Modula-3, Common Lisp (CLISP, Allegro CL, CFFI, UFFI) and Pike.

Useful info:





  • TclForth - A multi-platform desktop Forth system based on Tcl/Tk






R has bindings to Tcl/Tk (part of R, document).




  • I2cTcl - I2cTcl for Tcl/Tk on LINUX
  • KineTcl, a binding of the OpenNI framework (version 1), providing Tcl with access to MS Kinect (tm), and related sensor systems


  • tfirmata - a Tcl implementation of Arduino Firmata 2.3

Useful info:

Raspberry Pi

  • piio - supports both gpio and i2c

Useful info:


  • tcl-nano - A binary Tcl extension for working with the cryptocurrency Nano

Related Project

  • The Jim Interpreter: A small footprint implementation of the Tcl programming language
  • ParTcl - a micro Tcl implementation
  • Picol - A tiny Tcl interpreter

Write a Tcl extension

目前就我所知,Tcl extension 可以大致上分為二種形式, 一種是使用 C/C++ 與 TEA 架構撰寫的 extension。 可以從 Tcl 社群提供的 Sample extension 開始。

# Replace sample with the name of your extension
wget -qO- | tar xzv
cd sample
wget -qO- | tar xzv

# Write your source files
# Edit

# And then the usual:

另外一個使用 C/C++ 開發 Tcl 套件的方式是使用 Critcl (provides on-the-fly compilation and execution of C code).

還有的方式是使用 SWIG 來撰寫。 可以參考相關的文章 Tcl and SWIG as a C/C++ Development Tool.

一種是使用 pure Tcl 所撰寫的 exetnsion, 以 Tcl 檔案的形式或者是 Tcl Modules 的方式發佈。

Tcl Modules(.tm 檔案)在 Tcl/Tk 8.5 被 Tcl core team 所接受,所有的 code 都要放在同一個檔案裡, 這個機制並不是要取代之前的套件機制(使用 pkgIndex.tcl 這個 index script 來提供套件的資訊), 而是在減少彃性, 不用提供 pkgIndex.tcl 的情況下,實作提供 Tcl core 資訊並且減少存取檔案系統次數的套件機制。