Tcl 8.0a1/Tk 8.0a1 Release Announcement December 20, 1996 John Ousterhout Sun Microsystems, Inc. john.ousterhout@eng.sun.com This message is to announce new releases of the Tcl scripting language and the Tk toolkit. The new releases are Tcl 8.0a1 and Tk 8.0a1. Note that the Tk version number has jumped from 4.2 to 8.0 in order to synchronize the Tcl and Tk version members. These are major new releases with significant new features including a bytecode compiler for Tcl, native look and feel for Tk on the Macintosh and PC, and improvements to the Safe-Tcl security model. The "a1" in the release names indicates that these are the first "alpha" releases. The "alpha" means that the releases are likely to have bugs and are not yet feature-complete: we may add new features or change some of the existing features before the final 8.0 releases. Please let us know immediately about any problems you uncover with these releases. Where to get the new releases: ------------------------------ Tcl 8.0a1 and Tk 8.0a1 are currently available by public FTP from ftp.sunlabs.com in the directory /pub/tcl. The releases should appear on the usual mirror sites within a few days. The following files are available: - tcl8.0a1.tar.gz and tk8.0a1.tar.gz contain the unified source releases for all platforms (there are also .Z and .zip versions of these files). - Easy-to-install binary releases for some Unix platforms (e.g., Solaris and SunOS) may be purchased at the Sun Labs Tcl/Tk Shop: http://www.infohaus.com/access/by-seller/Sun_Labs_TclTk_Shop - tcl80a1.exe contains a binary release for the PC. This file contains compiled versions of Tcl, Tk, tclsh, and wish, along with libraries, demos, and manual pages (but no sources). The file is a self-extracting executable (run it and it installs everything). - mactk8.0a1.sea.hqx contains a binary release for the Mac. The file is in binhex format, which is understood by Fetch, StuffIt, and other Mac utilities. The unpacked file is a self-installing archive: double-click on it and it will create a folder containing everything you need to run Tcl and Tk. - Macintosh sources are also available in the "mac" subdirectory of the release area. See the README file in that directory for details. For additional information: --------------------------- There is a set of Web pages on Tcl and Tk maintained by the Tcl/Tk group at Sun Laboratories. They can be accessed via the following URL: http://www.sunlabs.com/research/tcl Changes in Tcl 8.0a1: --------------------- Here are the most significant changes in Tcl 8.0. In addition to these changes, there are several smaller changes and bug fixes. See the file "changes" for a complete list of all changes. 1. Bytecode compiler. The core of the Tcl interpreter has been replaced with an on-the-fly compiler that translates Tcl scripts to byte codes; a new interpreter then executes the byte codes. In earlier versions of Tcl, strings were used as a universal representation; in Tcl 8.0 strings are replaced with Tcl_Obj structures ("objects") that can hold both a string value and an internal form such as a binary integer or compiled bytecodes. The new objects make it possible to store information in efficient internal forms and avoid the constant translations to and from strings that occurred with the old interpreter. We have not yet converted all of Tcl to take full advantage of the compiler and objects and have not converted any of Tk yet, but even so you should see speedups of 2-3x on many programs and you may see speedups as much as 10-20x in some cases (such as code that manipulates long lists). Future releases should achieve even greater speedups. The compiler introduces only a few minor changes at the level of Tcl scripts, but it introduces many new C APIs for managing objects. See, for example, the manual entries doc/*Obj*.3. 2. Safe-Tcl enhancements. There is a new "hidden command" mechanism, implemented with the Tcl commands "interp hide", "interp expose", "interp invokehidden", and "interp hidden" and the C APIs Tcl_HideCommand and Tcl_ExposeCommand. There is now support for loadable security policies, including new library procedures such as tcl_safeCreateInterp. 3. There are new library procedures for doing GET, POST, and HEAD requests via the HTTP/1.0 protocol. See the manual entry http.n for details. 4. There are new library procedures for finding word breaks in strings. See the manual entry library.n for details. 5. There are new C APIs Tcl_Finalize (for cleaning up before unloading the Tcl DLL) and Tcl_Ungets for pushing bytes back into a channel's input buffer. 6. Binary data support. The new compiler C APIs allow any Tcl value to contain arbitrary binary data (strings are counted in addition to being null terminated). In this release, only a few parts of Tcl take advantage of these APIs, so you can't yet do much with binary data (e.g. the file commands haven't yet been updated to use the new APIs). In future releases we'll finish the changes to Tcl to use the new APIs so that binary data will be a first-class citizen in the Tcl world. In the meantime, be sure that any code you write using the new APIs uses explicit string lengths instead of depending on a null character for termination. Tcl 8.0 introduces the following incompatibilities that may affect Tcl scripts that worked under Tcl 7.6 and earlier releases: 1. The semantics of some Tcl commands have been changed slightly to maximize performance under the compiler. These incompatibilities are documented on the Web so that we can keep the list up-to-date. See the URL http://www.sunlabs.com/research/tcl/compiler.html. 2. The old Macintosh commands "cp", "mkdir", "mv", "rm", and "rmdir" are no longer supported; all of these features are now available on all platforms via the "file" command. Changes in Tk 8.0a1: -------------------- Here is a list of the most important new features in Tk 8.0. The release also includes several smaller feature changes and bug fixes. See the "changes" file for a complete list of all changes. 1. Native look and feel. The widgets have been rewritten to provide (nearly?) native look and feel on the Macintosh and PC. Many widgets, including scrollbars, menus, and the button family, are implemented with native platform widgets. Others, such as entries and texts, have been modified to emulate native look and feel. These changes are backwards compatible except that (a) some configuration options are now ignored on some platforms and (b) you must use the new menu mechanism described below to native look and feel for menus. 2. There is a new interface for creating menus, where a menubar is implemented as a menu widget instead of a frame containing menubuttons. The -menu option for a toplevel is used to specify the name of the menubar; the menu will be displayed *outside* the toplevel using different mechanisms on each platform (e.g. on the Macintosh the menu will appear at the top of the screen). See the menu demos in the widget demo for examples. The old style of menus still works, but does not provide native look and feel. 3. The font mechanism in Tk has been completely reworked: - Font names need not be nasty X LFDs: more intuitive names like {Times 12 Bold} can also be used. See the manual entry font.n for details. - Font requests always succeed now. If the requested font is not available, Tk finds the closest available font and uses that one. - Tk now supports named fonts whose precise attributes can be changed dynamically. If a named font is changed, any widget using that font updates itself to reflect the change. - There is a new command "font" for creating named fonts and querying various information about fonts. - There are now officially supported C APIs for measuring and displaying text. If you use these APIs now, your code will automatically handle international text when internationalization is added to Tk in a future release. See the manual entries MeasureChar.3, TextLayout.3, and FontId.3. - The old C procedures Tk_GetFontStruct, Tk_NameOfFontStruct, and Tk_FreeFontStruct have been replaced with more portable procedures Tk_GetFont, Tk_NameOfFont, and Tk_FreeFont. 4. Application embedding. It is now possible to embed one Tcl/Tk application inside another, using the -container option on frame widgets and the -use option for toplevel widgets or on the command line for wish. Embedding should be fully functional under Unix, but the implementation is incomplete on the Macintosh and PC. 5. Tk now works correctly with Safe-Tcl: it can be loaded into safe interpreters. 6. On Unix, default border widths have been changed from 2 to 1 to provide a more CDE-like appearance. 7. The "destroy" command now ignores windows that don't exist instead of generating an error. The only incompatibility introduced by this release of Tk is the removal of the procedures Tk_GetFontStruct, Tk_NameOfFontStruct, and Tk_FreeFontStruct, which only affects C code. However, the new compiler in Tcl 8.0 may affect Tcl/Tk scripts; check the Tcl documentation for information on incompatibilities introduced by Tcl 8.0. Credits: -------- Everyone in the Sun Tcl/Tk team contributed to this release. Here is a list of a few of the most important contributions and the people who made them: Bytecode compiler: Brian Lewis PC port (native look and feel etc.): Scott Stanton Mac port (native look and feel etc.): Ray Johnson Font mechanism: Colin Stevens Native menus: Syd Polk, John Ousterhout Safe-Tcl improvements: Jacob Levy, Brent Welch Application embedding: John Ousterhout, Scott Stanton, Ray Johnson Http library: Brent Welch Text images, gridder support: Stephen Uhler Standard dialogs: Ken Corey