Tcl HomeTcl Home Hosted by
ActiveState

Google SiteSearch

Thread Safety | Internationalization | Regular Expressions | TEA | Message Catalog | DDE | Byte Code Compiler | Dual-Ported Values | Native Look and Feel

Tcl has seen major improvements in the last few releases. The result is a high-performance, cross-platform scripting language with a robust, thread-safe implementation. For more detailed information about the new features in each version of Tcl/Tk, take a look at the Release Notes.

  • Tcl/Tk 8.5 is the current development release (not advised for general deployment). See the list of features and improvements in Tcl/Tk 8.5.
  • Tcl/Tk 8.4 is the latest stable release. See the list of features and improvements in Tcl/Tk 8.4.
  • Tcl/Tk 8.3 is the previous stable release. Tcl 8.3 incorporates numerous refinements of the Tcl core, providing significant new functionality and general usability enhancements. Among the notable new features are several upgrades to Tk, the graphical user interface toolkit for Tcl. Tcl 8.3 also includes greater list sorting capability and improved cross-platform file system support. Get a full list new features and improvements in Tcl 8.3.
  • In Tcl/Tk 8.2, instead of adding lots of new features, the focus of 8.2 is better support of the Tcl Extension Architecture and adoption of many contributed enhancements and bug fixes. The notable additions are:
    • First implementation of the Tcl Extension Architecture (TEA) for standardized configure and make processes.
    • Adoption of the Trf patch for stacked I/O channels, which supports compression and encryption extensions like SSL.
    • Addition of the "poke" operation to the DDE extension.
    • New procedures for manipulating strings that offer substantial performance improvements
    • Significantly faster performance on many string and regular expression operations.
  • Tcl/Tk 8.1 added thread-safety, Unicode support, and a new advanced regular expression engine.
  • Tcl/Tk 8.0 added an internal byte-code compiler for improved performance and native look and feel on Windows and Macintosh.

Support for Multi-Threaded Applications

With the Tcl/Tk support for thread safety, developers can now use Tcl in multi-threaded, high performance applications. Finally, all the benefits of scripting - rapid development, extensibility, powerful GUIs, and more - can be applied to multi-threaded applications.

Individual threads are allowed to use one or more interpreters as long as each interpreter (and any slave interpreters) is only accessed by one thread. Interpreters in different threads communicate by sending Tcl scripts to other threads for evaluation. There are new C APIs for mutexes, condition variables, and thread local storage.

Internationalization

Tcl's new internationalization facilities allow developers to create Tcl applications that support any multi-byte language, including Chinese and Japanese. Tcl is the first cross-platform scripting language to help developers to deploy both commercial and enterprise network applications on a global scale.

Tk has also undergone a major overhaul to support the new internationalization features of Tcl. The font package has been rewritten to support arbitrary Unicode characters; when you specify a particular font such as "Times 12", Tk may actually use additional fonts to display Unicode characters that don't exist in the font you chose. Tk guarantees to find a way to display any Unicode character regardless of the font you selected, as long as there is some font in the system that contains the Unicode character. The input method support in Tk has also been modified to support full Unicode characters.

Advanced Regular Expressions

Tcl features an all-new regular expression package developed by Henry Spencer, the world renowned expert on regular expressions. The two major additions are Unicode support, so you can process text from any language with regular expressions, and Advanced Regular Expressions (AREs). These features make Tcl regular expressions the best available today.

Tcl Extension Architecture (TEA)

It has always been easy to extend Tcl with new commands. However, lack of makefile standards and differences in dynamic loading facilities have made it difficult to share extensions, either as source code or binary distributions. The Tcl Extension Architecture (TEA) provides standards for extension writers so all Tcl extensions can be built in a common framework, and easily shared by others in the Tcl community.

Tcl uses autoconf, configure, and make for its build process on both Unix and Windows. TEA includes a set of standard autoconf macros that extension authors can use to create their own highly portable extensions. There are also sample project files for the Macintosh and Windows compilers.

Tcl implements its own form of dynamic linking through a "stub library" mechanism. An extension that links against the stub library can be used across multiple versions of Tcl. It is also possible to create statically linked Tcl shells that can still dynamically load extensions linked against the stub library.

Other Improvements Introduced in Tcl 8.1

Message catalog

There is a new message catalog package which makes it easy to localize the strings in a script.

DDE support

A DDE package has been added for the Windows platform. This allows Tcl applications to use DDE to communicate with other Windows applications. This package is not yet a complete replacement for the Tk send command. Note that this package is usable from Tcl shells.

Configuration options

There is a new library of C procedures for manipulating widget configuration options using Tcl_Objs instead of strings. This should eventually make Tk much more efficient. Label, button, checkbutton, radiobutton, and menu widgets have been modified to use the new library.

More Tcl_Obj support

Several additional C library procedures have been added to support Tcl_Objs.

Tk embedding

Tk embedding now also works on the Macintosh, as long as both the container and embedded application are in the same process.

Binary data

Binary data is handled differently since Tcl 8.1 than in Tcl 8.0. Tcl now uses the UTF-8 facilities to represent binary data: the character value zero is represented with a multi-byte sequence, so that (once again) strings in Tcl never contain null bytes. This means that binary data is now accepted everywhere in Tcl and Tk (in Tcl 8.0 the support for binary data was incomplete). If you have C code that needs to manipulate the bytes of binary data (as opposed to just passing the data through) you should use a new object type called "byte array". ·

Byte Code Compiler

Tcl 8.0 introduced a byte-code compiler for Tcl. The compiler works transparently, automatically compiling code the first time it is executed. Performance improvements can be large for specific operations, especially list operations. Execution speed for a whole application is generally about twice as fast as earlier versions of Tcl.
  • TclPro Compiler lets you write out byte-codes and load them directly. This lets you distribute compiled code instead of plain Tcl scripts.
  • Compiler Notes describe effects that the compiler has on Tcl script execution.

Dual Ported Values

Tcl 8.0 also introduced a new data type, Tcl_Obj to replace the use of simple strings in the Tcl command interface. This dual ported value stores both a string representation of a value as well as a native representation such as a 32-bit integer, a double-precision floating point number, a Tcl list, binary data, or Tcl byte codes. Tcl automatically manages these values so their type is transparent to the Tcl script writer. However, conversions between strings and native representations is done in a lazy manner, so the Tcl C library is able to avoid the cost of string conversions.

Tcl still supports the string-based interface to Tcl command implementations. However, commands that use the Tcl_Obj interface will run more effiicently.

Native Look and Feel

Tcl 8.0 improved the cross-platform features of the Tk GUI toolkit so it honors the native look and feel of Unix, Windows, and Macintosh as much as possible. The same Tcl/Tk script will have a different appearance and default widget bindings depending on the current platform. Platform-independent font names were introduced so you can name fonts with names like "times 10 bold" instead of the complex X logical font descriptors. Tk is also able to do automatic font substitution when you use platform-independent font names.