Tcl is a cross platform language with full unicode support.
Flexibility: redefine or enhance existing commands or write new commands.
Event driven programming: Event driven I/O and variable tracing.
Library Interface: It is very easy to integrate existing C libraries into Tcl and provide a Tcl interface to the C library. These interface “stubs” are not tied to any particular version of Tcl and will continue to work even after upgrading Tcl.
Tcl Interface: Tcl provides a complete API so you use the Tcl interpreter from within your C/Python/Ruby/Java/R program.
|8.6.6||Current Patch Release.||2016-07-27|
|8.6.0||Current recommended version series for new code. Introduced object system and non-recursive execution engine.||2013-09-20|
|8.5.19||Current LTS release||2016-02-12|
|8.5.0||Current oldest supported version. Introduced expansion syntax, dictionaries and ensemble commands.||2007-12-20|
|8.4.20||Final 8.4 series release. There will be no further releases of 8.4.||2013-06-01|
|8.4.0||First release by Tcl Core Team. Many performance enhancements. Improved 64-bit support.||2002-09-18|
|8.1||Introduced Unicode support.||1999-04-30|
|8.0||Introduced bytecode compilation engine||1997-08-16|
Installing Tcl 8.6.4 on Windows :
The easiest way to get Tcl on a windows machine is to install the ActiveTcl distribution from ActiveState.
Navigate to www.activestate.com and follow the links to download the Free Community Edition of ActiveTcl for Windows (choose 32/64 bit version appropriately).
Run the installer which will result in a fresh install of ActiveTcl usually in the C:\Tcl directory.
Open a command prompt to test the install, type in “tclsh” which should open an interactive tcl console. Enter “info patchlevel” to check the version of tcl that was installed and it should display an output of the form “8.6.x” depending on the edition of ActiveTcl that has been downloaded.
You may also want to add “C:\Tcl\bin” or its equivalent to your environment PATH variable.
C:>tclsh % info patchlevel 8.6.4
The Hello, world program in Tcl (and Tk)
The following code can be entered in a Tcl shell (
or into a script file and run through a Tcl shell:
puts "Hello, world!"
It gives the string argument
Hello, world! to the command
puts command writes its argument to standard out (your terminal in interactive mode) and adds a newline afterwards.
In a Tk-enabled shell, this variation can be used:
pack [button .b -text "Hello, world!" -command exit]
It creates a graphic button with the text
and adds it to the application window. When pressed,
the application exits.
A Tk-enabled shell is started as:
tclsh along with the following statement:
package require Tk
Features of Tcl
- Cross Platform Portability
- Runs on Windows, Mac OS X, Linux, and virtually every variant of unix.
- Event driven programming
- Trigger events based on variable read / write / unset.
- Trigger events when a command is entered or left.
- Trigger events when a I/O channel (file or network) becomes readable / writable.
- Create your own events.
- Trigger a command based on a timer.
- Object Oriented Programming
- Superclasses and subclasses.
- Simple Grammar
- Full unicode support
- It just works. No special commands are needed to handle unicode strings.
- Convert to and from different encoding systems with ease.
- Create new control structures and commands.
- Access variables in the calling procedure’s context.
- Execute code in the calling procedure’s context.
- Powerful introspection capabilities.
- Many Tcl debuggers have been written in Tcl.
- Library interface
- Integrate existing C libraries and provide a Tcl interface to the library.
- Library “stubs” are not tied to any particular version of Tcl and will still work after a Tcl upgrade.
- Complete API
- Embed a Tcl interpreter into your favorite language.
- Python, Ruby, R, Java and others include a Tcl API.
- Embedded bigint library.
- No special actions are needed to handle very large numerics.
- Safe interpreters
- Create sandboxes in which user code can be run.
- Enable and disable specific commands for the interpreter.
- Regular Expressions
- A powerful and fast regular expression engine written by Henry Spencer (creator of regex).
Installing packages through teacup
Now days many languages are supporting archive server to install their packages into your local machine. TCL also having same archive server we called it as Teacup
teacup version teacup search <packageName>
teacup install Expect