After 27 years, Tcl/Tk 9 finally arrives with 64-bit power and Zip file magic
- Reference: 1727869548
- News link: https://www.theregister.co.uk/2024/10/02/tcltk_version_9/
- Source link:
The Tcl/Tk team doesn't rush into new versions. The previous major release, version 8.0, was in 1997, and the last minor release, version 8.6, came out in 2012. Now [1]version 9.0 introduces some significant additions, including 64-bit support – and some breaking changes.
Tcl/Tk – which stands for " [2]Tool Command Language " and " [3]ToolKit ," pronounced "tickle-teak" – is a tiny programming language with its own integrated toolkit for writing GUIs. Tcl was first released way back in 1988, before Linux, FreeBSD, NetBSD, or even Windows 3.0.
[4]
Over a nearly [5]four-decade timeline , it has grown – but not by anywhere near as much as many comparable projects. It started out considerably smaller than, for instance, another scripting language often described as small and simple, Lua, which didn't appear until six years later.
[6]
[7]
Tcl/Tk 9 remains relatively small and simple today. What's changed is that it can now take on much bigger, and indeed richer, chunks of data. It is now internally 64-bit, so as the release notes say:
Strings can be any length (that fits in your available memory).
Lists and dictionaries can have very large numbers of elements.
(The release notes for Tcl 9 and Tk 9 are two separate Markdown files, which complicates linking directly to them – but you can download both from the project's [8]SourceForge page . Yes, SourceForge: Tcl was nearly old enough to vote when Git first appeared, so only a mirror of the source code is [9]on GitHub . SourceForge is [10]better behaved than it once was, and along with Slashdot [11]is now part of BizX .)
Tcl 9 also natively supports Unicode and can directly access Zip files (as well as several other archive formats, such as .jar and .tar files), meaning that you can open the compressed file directly and navigate its contents as if they were a normal file system.
Although it is not an especially fast language, version 9 supports both the Linux [12]epoll() and BSD-style [13]kqueue() event-notification APIs to help write more responsive code.
[14]
Tk 9 has been modernized too. It is scaling-aware, for HiDPI displays, supports two-finger mouse gestures, can access the OS's notifications, system tray, and printing subsystems, access photo metadata, and has partial support for the XML-based SVG image format. It also has a wide range of themes, some of which can be seen in this [15]screenshot gallery – although we note that it hasn't been updated for Tk 9 yet.
For some, Tcl's appeal is its simplicity. Its core principles are outlined in just 12 rules, which the project calls [16]the Dodekalogue . Colin Macleod's article, " [17]Why I'm Tcl-ish ," calls it "clean, logical, and consistent," and compares it favorably to Lisp. We also rather liked Will Duquette's [18]description :
The Tcl language is made up of commands ; a command has a name and takes an argument list, with which it can do literally anything. The standard commands are written in C; Tcl proc s are commands that are written in Tcl. The control structures, like if and foreach and while is just a Tcl command. The proc command that defines a proc is just a Tcl command.
I think of it as Lisp for C programmers.
In fact, several commenters in the [19]Hacker News thread about the new release compared it to Lisp:
Such an elegant language: simple, easy to learn, flexible. I call it Lisp for humans.
Or…
It possesses the elegance of Lisp while maintaining practicality.
[20]20 years of .NET: Reflecting on Microsoft's not-Java
[21]'MongoDB ate my containers!'
[22]Digia gives Android and iOS devs a chance to get Qt
[23]Google native code browser plug-in gets tickled
And [24]earlier :
Tcl is like a Lisp where space-separated strings take the place of S-expressions.
Even if Lisp has some [25]weighty admirers , comparisons to it may put off as many people as they encourage. So perhaps some other plaudits might help.
Another famously small and simple tool, SQLite, which as [26]The Register said in 2020 "claims to be 'used more than all other database engines combined,'" [27]emerged from the Tcl project :
The SQLite library is designed to be very easy to use from a Tcl or Tcl/Tk script. SQLite began as a Tcl extension and the primary test suite for SQLite is written in Tcl. SQLite can be used with any programming language, but its connections to Tcl run deep.
Redis has [28]gained considerable attention recently . Its original author, Salvatore Sanfilippo, admires Tcl, as his essay " [29]Tcl the Misunderstood " spells out. It's subtitled "Why Tcl is not a toy language, but a very powerful one."
Tcl/Tk 9 is a substantial change, and not all programs will come across unmodified. As the announcement says:
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.
If this proves too hard, the release notes hint:
The experiences of Tcl/Tk 8 users adapting their code to Tcl/Tk 9 will determine the need for possible Tcl 8.7 releases that might supply additional life cycle and migration support. ®
Get our [30]Tech Resources
[1] https://www.tcl-lang.org/software/tcltk/9.0.html
[2] https://wiki.tcl-lang.org/page/Tcl+vs%2E+TCL
[3] https://wiki.tcl-lang.org/page/Tk
[4] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2Zv1uJnKFsntpXb-3spyPMgAAAM8&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0
[5] https://wiki.tcl-lang.org/page/Tcl+chronology
[6] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44Zv1uJnKFsntpXb-3spyPMgAAAM8&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[7] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33Zv1uJnKFsntpXb-3spyPMgAAAM8&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[8] https://sourceforge.net/projects/tcl/files/Tcl/9.0.0/
[9] https://github.com/tcltk/tcl
[10] https://www.theregister.com/2015/06/03/sourceforge_to_offer_only_optin_adware_after_gimp_grump/
[11] https://www.theregister.com/2016/02/01/slashdot_and_sourceforge_acquired/
[12] https://www.man7.org/linux/man-pages/man7/epoll.7.html
[13] https://man.freebsd.org/cgi/man.cgi?kqueue
[14] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44Zv1uJnKFsntpXb-3spyPMgAAAM8&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[15] https://wiki.tcl-lang.org/page/List+of+ttk+Themes
[16] https://wiki.tcl-lang.org/page/Dodekalogue
[17] https://colin-macleod.blogspot.com/2020/10/why-im-tcl-ish.html
[18] https://news.ycombinator.com/item?id=41662794
[19] https://news.ycombinator.com/item?id=41661906
[20] https://www.theregister.com/2022/02/15/20_years_of_dotnet/
[21] https://www.theregister.com/2016/06/08/line_break_season_2_ep_1/
[22] https://www.theregister.com/2013/10/09/android_ios_get_cute_with_qt/
[23] https://www.theregister.com/2011/04/14/tcl_on_native_client/
[24] https://news.ycombinator.com/item?id=41108667
[25] https://www.paulgraham.com/avg.html
[26] https://www.theregister.com/2020/08/19/sqlite_maximum_database_size_increased_281tb/
[27] https://sqlite.org/tclsqlite.html
[28] https://www.theregister.com/2024/03/22/redis_changes_license/
[29] http://antirez.com/articoli/tclmisunderstood.html
[30] https://whitepapers.theregister.com/
Also in Python
The "standard" GUI for Python is Tcl/Tk. It's part of the standard Python library, although many Linux distros make it an optional package.
Here's a quote from the Python documentation about it.
Tk/Tcl has long been an integral part of Python. It provides a robust and platform independent windowing toolkit, that is available to Python programmers using the tkinter package, and its extension, the tkinter.tix and the tkinter.ttk modules.
The tkinter package is a thin object-oriented layer on top of Tcl/Tk. To use tkinter, you don’t need to write Tcl code, but you will need to consult the Tk documentation, and occasionally the Tcl documentation. tkinter is a set of wrappers that implement the Tk widgets as Python classes.
I've used it when I needed a cross-platform GUI. It worked just fine for the job in question.
Re: Also in Python
[Author here]
> The "standard" GUI for Python is Tcl/Tk.
I am not a Python person at all, but I think, according to my limited understanding, that `tkinter` is a wrapper around Tk, but that not much Tcl is involved.
As Wikipedia puts it:
«
Tkinter is a Python binding to the Tk GUI toolkit.
»
It's the Tk half, not the whole thing. Tk without its native programming language. Its package page on python.org says:
«
Tkinter is not a thin wrapper, but adds a fair amount of its own logic to make the experience more pythonic.
»
Internally 64-bit? Cool no more year 2038 bug problems!
Clearlooks...
...how desktop applications still ought to look.