Tcl/Tk 9.0来了
专栏:偷懒小技巧 Jan. 22, 2024, 11:45 a.m. 86 阅读
2024年1月8日,Tcl核心团队宣布Tcl/Tk 9.0发布了。我们还记得2015年发布了perl6,但似乎快十年过去了,perl6仍然没有流行起来。tcl9是否会布perl6的后尘,我们将持续关注。

2024年1月8日,Tcl核心团队宣布Tcl/Tk 9.0测试版发布了。本次发布包括Tcl动态语言包和Tk图形界面包,是9.0的第一个测试版本。9.0是tcl和tk的大版本更新,距tcl8.6首次发布,2012年,已过去12年。我们来一起看看有哪些新功能。

Tcl 9新功能

  • 64-bit容量: 数值最大支持2Gb

  • 文字的国际化

    • Full Unicode range of codepoints

    • New encodings: utf-16(le|be), ucs-2(le|be), CESU-8, etc.

    • [encoding] options -profile, -failindex manage encoding of I/O.

    • [msgcat] supports custom locale search list

    • [source] defaults to -encoding utf-8

  • Zip文件和压缩格式附件

  • epoll()或kqueue()的Unix通知

    • relieves limits on file descriptors imposed by legacy select()

  • 与旧版本主要不兼容

    • Unqualified varnames resolved in current namespace, not global.

    • 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

    • Removed the "identity" encoding

    • $::tcl_precision no longer controls string generation of doubles

    • Removed Tcl 7 legacies: [case], [puts] [read] variant syntaxes

    • Removed subcommands [trace variable|vdelete|vinfo]

  • C语言接口的不兼容

    • Many arguments expanded type from int to Tcl_Size

    • 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

    • 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()

  • 新命令

    • [array default], [array for]

    • [coroinject], [coroprobe]

    • [clock add weekdays]

    • [const], [info const*]

    • [dict getdefault]

    • [file tempdir], [file home], [file tildeexpand]

    • [info commandtype]

    • [ledit]

    • [lpop]

    • [lremove]

    • [lseq]

    • [package files]

    • [string insert], [string is dict]

    • [tcl::process]

  • 命令的新参数

    • [regsub ... -command ...]

    • [lsearch ... -stride ...]

    • [socket ... -nodelay ... -keepalive ...]

    • [vwait] controlled by several new options

  • 数字

    • 0NNN format is no longer octal interpretation. Use 0oNNN.

    • 0dNNNN format to compel decimal interpretation.

    • NN_NNN_NNN, underscores in numbers for optional readability

    • Functions: isinf() isnan() isnormal() issubnormal() isunordered()

    • [fpclassify]

    • Function int() no longer truncates to word size

  • tcl::oo

    • private variable and methods

    • [method -export], [method -unexport]

Tk 9新功能

  • 平台相关的方面改进了很多

    • 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

  • 新命令和新参数

    • [tk sysnotify]: access to the OS notifications system

    • [tk systray]: access to the OS tray facility

    • [tk print]: access to the OS printing facility

  • Widget选项

    • New ttk::progressbar option: -text

    • [$frame ... -backgroundimage $img -tile $bool]

    • [$menu id], [$menu add|insert ... ?$id? ...]

    • [$image get ... -withalpha ...]

  • widget外观改进

    • ttk::notebook with nondefault tab positions

  • 图像

    • Partial SVG support

    • Read/write access to photo image metadata

在哪里下载和安装

Tcl/Tk 9.0b1源码开源在SourceForge: https://sourceforge.net/projects/tcl/files/ ,可以从源码编译安装。

第三方预编译的二进制版本可以关注这个页面,跟踪第三方的后续发布:https://www.tcl-lang.org/software/tcltk/bindist.html

我们还记得2015年发布了perl6,但似乎快十年过去了,perl6仍然没有流行起来。tcl9是否会布perl6的后尘,我们将持续关注。

 

感谢阅读,更多文章点击这里:【专栏:偷懒小技巧】