공지
Tcl/Tk 9.0 릴리즈
출처: https://www.tcl-lang.org/software/tcltk/9.0.html
Latest Release: Tcl/Tk 9.0.1 (Dec 20, 2024)
Tcl/Tk 9.0 is the latest major release of both Tcl and Tk. It features many new capabilities, and presents some incompatibilities with Tcl/Tk 8.
Download Tcl/Tk 9.0.1 Source Releases
Highlights of Tcl 9.0
- 64-bit Capacity: Data values larger than 2Gb

- Unicode and Encodings: full codepoint range, added encodings, encoding profiles to govern I/O, and more.
- Zip Filesystems: mount zipfiles as filesystems
- Attached Archives: enable starkit-style deployment of apps, with support data in filesystem archives attached to executable or libraries. Build tclsh and wish this way.
- New Notifiers: The central event handling engine in Tcl is now constructed on top of the system calls epoll or kqueue when they are available. The select based implementation also remains for platforms where they are not.
- Many new commands and features
See below for a more complete summary of changes in Tcl.
Important Incompatibilities in Tcl 9.0
- Namespace varname resolution: Current namespace, not global.
- I/O malencoding: now raises error by default.
- Tilde (~) in pathnames: no longer interpreted as home directory.
- tcl_precision no longer has effect on number formatting
Highlights of Tk 9.0
- Access to OS facilities: notifications , print , and tray systems
- Scalable Vector Graphics: partial support in images, extensive use to enable scalable widget and theme appearances.
- Images: full access to metadata and alpha channel.
- Platform Features and Conventions: many improvements, including two-finger gesture support where available.
See below for a more complete summary of changes in Tk.
Porting code to Tcl 9
Many Tcl programs written for Tcl 8 will run unchanged in Tcl 9. Many more Tcl programs can be modified in small and simple ways to produce a new program that runs in both Tcl 8 and Tcl 9. Extensions and applications using the public Tcl C APIs will involve more effort, but it is still within reasonable reach to produce source code supporting both Tcl 8 and Tcl 9 while both releases remain in widespread use.
Tk 9.0.0 does not support Tcl 8.6. Tk 9.0.0 extends Tcl 9.0.0. To make use of Tk 9.0.0, first the new Tcl release, Tcl 9.0.0, needs to be present. As new Tk features are developed, expect them to appear in Tk 9, but not necessarily in Tk 8.6.
See the following links for an accumulation of migration advice:
There has been much progress already porting many known applications, extensions, and packages in the Tcl world to compatibility with Tcl/Tk 9:
Summary of changes for Tcl
Major Features
- 64-bit capacity: Data values larger than 2 GB
- Strings can be any length (that fits in your available memory)
- Lists and dictionaries can have very large numbers of elements
- Internationalization of text
- Full Unicode range of codepoints
- New encodings:
utf-16/utf-32/ucs-2(le|be),CESU-8, etc. encodingoptions-profile,-failindexmanage encoding of I/Omsgcatsupports custom locale search listsourcedefaults to-encoding utf-8
- Zip filesystems and attached archives
- Packaging of the Tcl script library with the Tcl binary library, meaning that the
TCL_LIBRARYenvironment variable is usually not required - Packaging of an application into a virtual filesystem is now a supported core Tcl feature
- Unix notifiers available using
epoll()orkqueue() - This relieves limits on file descriptors imposed by legacy
select()and fixes a performance bottleneck
Notable incompatibilities
- Unqualified varnames resolved in current namespace, not global. Note that in almost all cases where this causes a change, the change is actually the removal of a latent bug
- No
--disable-threadsbuild option. Always thread-enabled - I/O malencoding default response: raise error (
-profile strict) - Windows platform needs Windows 7 or Windows Server 2008 R2 or later
- Ended interpretation of
~as home directory in pathnames (seefile homeandfile tildeexpandfor replacements when you need them) - Removed the
identityencoding (there were only ever very few valid use cases for this; almost all uses were systematically wrong) - Removed the encoding alias
binarytoiso8859-1 $::tcl_precisionno longer controls string generation of doubles (if you need a particular precision, useformat)- Removed pre-Tcl 8 legacies:
case,putsandreadvariant syntaxes - Removed subcommands
trace variable|vdelete|vinfo - Removed
-eofcharoption for write channels - On Windows 10+ (Version 1903 or higher), system encoding is always utf-8
%b/%d/%o/%xformat modifiers (without size modifier) forformatandscanalways truncate to 32-bits on all platforms%Lsize modifier forscanno longer truncates to 64-bit- Removed command
::tcl::unsupported::inject(seecoroinjectandcoroprobefor supported commands with significantly more comprehensible semantics)
Incompatibilities in C public interface
- Extensions built against Tcl 8.6 and before will not work with Tcl 9.0; ABI compatibility was a non-goal for 9.0. In most cases, rebuilding against Tcl 9.0 should work except when a removed API function is used
- Many arguments expanded type from
inttoTcl_Size, a signed integer type large enough to support 64-bit sized memory objects. The constantTCL_AUTO_LENGTHis a value of that type that indicates that the length should be obtained using an appropriate function (typicallystrlen()forchar *values) - Ended support for
Tcl_ChannelTypeVersionless than 5 - Introduced versioning of the
Tcl_ObjTypestruct - Removed macros
CONST*: Tcl 9 support means dropping Tcl 8.3 support. (Replaced with standard Cconstkeyword going forward) - Removed registration of several
Tcl_ObjTypes - Removed API functions:
Tcl_Backslash()Tcl_*VA()Tcl_*MathFunc*()Tcl_MakeSafe()Tcl_(Save|Restore|Discard|Free)Result()Tcl_EvalTokens()Tcl_(Get|Set)DefaultEncodingDir()Tcl_UniCharN(case)cmp()Tcl_UniCharCaseMatch()
- Revised many internals; beware reliance on undocumented behaviors
New commands
array default— Specify default values for arrays (note that this alters the behaviour ofappend,incr,lappend)array for— Cheap iteration over an array contentschan isbinary— Test if a channel is configured to work with binary datacoroinject,coroprobe— Interact with paused coroutinesclock add weekdays— Clock arithmetic with week daysconst,info const*— Commands for defining constants (variables that can be modified)dict getwithdefault— Define a fallback value to use whendict getwould otherwise failfile home— Get the user home directoryfile tempdir— Create a temporary directoryfile tildeexpand— Expand a file path containing a~info commandtype— Introspection for the kinds of commandsledit— Equivalent tolreplacebut on a list in a variablelpop— Remove an item from a list in a variablelremove— Remove a sublist from a list in a variablelseq— Generate a list of numbers in a sequencepackage files— Describe the contents of a packagestring insert— Insert a string as a substring of another stringstring is dict— Test whether a string is a dictionarytcl::process— Commands for working with subprocesses*::build-info— Obtain information about the build of TclreadFile,writeFile,foreachLine— Simple procedures for basic working with filestcl::idna::*— Commands for working with encoded DNS names
New command options
chan configure ... -inputmode ...— Support for raw terminal input and reading passwordsclock scan ... -validate ...info loaded ... ?prefix?lsearch ... -stride ...— Search a list by groups of itemsregsub ... -command ...— Generate the replacement for a regular expression by calling a commandsocket ... -nodelay ... -keepalive ...vwaitcontrolled by several new optionsexprstring comparatorslt,gt,le,geexprsupports comments inside expressions
Numbers
0NNNformat is no longer octal interpretation. Use0oNNN0dNNNNformat to compel decimal interpretationNN_NNN_NNN, underscores in numbers for optional readability- Functions:
isinf(),isnan(),isnormal(),issubnormal(),isunordered() - Command:
fpclassify - Function
int()no longer truncates to word size
TclOO facilities
- private variables and methods
- class variables and methods
- abstract and singleton classes
- configurable properties
method -export,method -unexport
Summary of changes for Tk
Many improvements to use of platform features and conventions
- Built-in widgets and themes are scaling-aware
- Improved support of two-finger gestures, where available
- The
tk windowingsystem“aqua” needs macOS 10.10 or later
New commands and options
tk sysnotify— Access to the OS notifications systemtk systray— Access to the OS tray facilitytk print— Access to the OS printing facility
Widget options
- New
ttk::progressbaroption: -text $frame ... -backgroundimage $img -tile $bool$menu id,$menu add|insert ... ?$id? ...$image get ... -withalpha ...- New
ttk::comboboxandttk::entryoptions: -placeholder and -placeholderforeground - All indices now accept the forms end, end-int, int+|-int
Improved widget appearance
ttk::notebookwith nondefault tab positions
Images
- Partial SVG support
- Read/write access to photo image metadata