Artifact 358e196f396e0fa27cce4c226cea8f4bccdf2d2b722fcfa78e8998817b8c50e6:
- File changes.md — part of check-in [10600da325] at 2024-09-18 20:28:20 on branch core-9-0-0-rc — One more "Known bugs" (user: jan.nijtmans size: 7560)
The source code for Tcl is managed by fossil. Tcl developers coordinate all changes to the Tcl source code at
Release Tcl 9.0.0 arises from the check-in with tag core-9-0-0
.
Highlighted differences between Tcl 9.0 and Tcl 8.6 are summarized below, with focus on changes important to programmers using the Tcl library and writing Tcl scripts.
Major Features
64-bit capacity: Data values larger than 2Gb
- 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. encoding
options-profile
,-failindex
manage encoding of I/O.msgcat
supports custom locale search listsource
defaults to-encoding utf-8
Zip filesystems and attached archives.
- Packaging of the Tcl script library with the Tcl binary library,
meaning that the
TCL_LIBRARY
environment 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()
or kqueue()
- This relieves limits on file descriptors imposed by legacy
select()
and fixes a performance bottleneck.
Incompatibilities
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-threads
build 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 home
andfile tildeexpand
for replacements when you need them.) - Removed the
identity
encoding. (There were only ever very few valid use cases for this; almost all uses were systematically wrong.) - Removed the encoding alias
binary
toiso8859-1
. $::tcl_precision
no longer controls string generation of doubles. (If you need a particular precision, useformat
.)- Removed pre-Tcl 8 legacies:
case
,puts
andread
variant syntaxes. - Removed subcommands [
trace variable
|vdelete
|vinfo
] - No
-eofchar
option for channels anymore for writing. - On Windows 10+ (Version 1903 or higher), system encoding is always utf-8.
%b
/%d
/%o
/%x
format modifiers (without size modifier) forformat
andscan
always truncate to 32-bits on all platforms.%L
size modifier forscan
no longer truncates to 64-bit.- Removed command
::tcl::unsupported::inject
. (Seecoroinject
andcoroprobe
for supported commands with significantly more comprehensible semantics.)
Incompatibilities in C public interface
- Many arguments expanded type from
int
toTcl_Size
, a signed integer type large enough to support 64-bit sized memory objects. The constantTCL_AUTO_LENGTH
is a value of that type that indicates that the length should be obtained using an appropriate function (typicallystrlen()
forchar *
values). - Ended support for
Tcl_ChannelTypeVersion
less than 5 - Introduced versioning of the
Tcl_ObjType
struct - Removed macros
CONST*
: Tcl 9 support means dropping Tcl 8.3 support. (Replaced with standard Cconst
keyword going forward.) Removed routines:
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()
Note that builds of extensions against Tcl 8.6 and before are expected to not work with Tcl 9.0; ABI compatibility was a non-goal for 9.0. In most cases, rebuilding the code against Tcl 9.0 should work except when a removed API function is used.
New Features
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's contents.chan isbinary
— Test if a channel is configured to work with binary data.coroinject
,coroprobe
— Interact with paused coroutines.clock add weekdays
— Clock arithmetic with week days.const
,info const*
— Commands for defining constants (variables that can't be modified).dict getwithdefault
— Define a fallback value to use whendict get
would otherwise fail.file home
— Get the user home directory.file tempdir
— Create a temporary directory.file tildeexpand
— Expand a file path containing a~
.info commandtype
— Introspection for the kinds of commands.ledit
— Equivalent tolreplace
but on a list in a variable.lpop
— Remove an item from a list in a variable.lremove
— Remove a sublist from a list in a variable.lseq
— Generate a list of numbers in a sequence.package files
— Describe the contents of a package.string insert
— Insert a string as a substring of another string.string is dict
— Test whether a string is a dictionary.tcl::process
— Commands for working with subprocesses.*::build-info
— Obtain information about the build of Tcl.readFile
,writeFile
,foreachLine
— Simple procedures for basic working with files.tcl::idna::*
— Commands for working with encoded DNS names.
New command options
chan configure ... -inputmode ...
— Support for raw terminal input and reading passwords.clock scan ... -validate ...
info loaded ... ?prefix?
lsearch ... -stride ...
— Search a list by groups of items.regsub ... -command ...
— Generate the replacement for a regular expression by calling a command.socket ... -nodelay ... -keepalive ...
vwait
controlled by several new optionsexpr
string comparatorslt
,gt
,le
,ge
expr
supports comments inside expressions
Numbers
0NNN
format is no longer octal interpretation. Use0oNNN
.0dNNNN
format to compel decimal interpretation.NN_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
Known bugs
- Command line built with list not properly quoted
- changed behaviour wrt command names, namespaces and resolution
- classmethod fails if no argument supplied to class create
- windows dos device paths inconsistencies and missing functionality
- zlib-8.8, zlib-8.16 fail on Fedora 40, gcc 14.1.1
- Temporary folder with file "tcl9registry13.dll" remains after "exit"