Tcl/Tk 9.1
tcl-lang.org
tcl-lang.org
Python is that kind of cool one behaves when visiting parents of your would be spouse for the first time. Tcl on the other hand is like playing one's secret exclusive and somewhat dangerous games with kid school bestie.
Tcl/Tk pioneered the notion of a scripting language as a library. It got threading right. You can run multiple independent Tcl interpreters in the address space of your process and they can exchange messages. Entirety of interpreter state is encapsulated inside the interpreter object, no globals. To a user an it is just a pointer to an object.
No need for GIL, no need for serialization/deserialization (pickle/unpickle) ... just within process memory copy (or no copies in case data is immutable).
That was my first web kind of framework. The naivette of Zope still amuses me endlessly to this very day.
It tried to be cool, made ALL the wrong choices, and died silently with people just moving on.
I will never recover from debugging ZODB backed by Oracle. Well, somewhat backed.
Who, like, who thought it was cool to have a pickle-based, mostly in-memory, single process, aaalmost transactional database?!
I was more traumatized by the Java-based product from Open Market (acquired from Future Tense back in the day), and all the horribleness that that entailed. Starting from XML as a template language, then seemed to get only worse. Nothing like having multiple content areas all rendered as 500 Server Error pages within one page, when it all goes sideways.
If you need something safe then you really need to identify your requirements and your threat model first anyway; I wouldn't blindly reach for a one-size-fits-all solution in any programming language.
(Although I would do a quick check to see JSON or TOML is sufficient and practical.)
'prepone' is an example of why I sometimes agree. Most indian guys I know also up the baudrate of english so much that they get twice the information flow compared to british english. With the disadvantage that both sides of the conversation need to speak indian english or you'll get protocol errors :-D
This was their attempt to position Tcl as an alternative to JS. The sub-interpreters were introduced as controllable sandboxes for running untrusted code with reduced privilege. Instead we got a web scripting language that allows untrusted code to interact with your USB devices. Python sub-interpreters are a joke compared to what Tcl has.
One could call Tcl_CreateInterp() multiple times in your code and each call would return an independent interpreter.
This is funny because so much Silicon CAD automation is written in TCL. I mean the most advanced technology in the world depends on TCL in its pipeline (also Excel VBasic!) (let's not talk about COBOL, that's in banking)
TCL is the original extension language, and in the very hidebound electronics CAD world, has a very long tail.
I would hazard a guess that a significant fraction of HNers would have encountered TCL in silicon CAD and took with them a frustrating experience.
Additionally maybe we should stop complaining about its verbosity, given the amount of English based programming going on nowadays.
Unfortunately, it isn't getting much use anymore because of changes in architecture, but it was easy enough and the control I used for logs was much better than the c# forms stuff it replaced that would pin the CPU 100% and OOM after a few thousand lines.
If I read it today, it makes as much sense as Mayan pictographs, though.
The bit I really like about Tcl is how easy it makes asynchronous I/O across all its supported platforms. This doesn't sound significant to Linux users, but on Windows that's a very very big deal...
From D. Richard Hipp [1]:
"SQLite is a TCL extension that has escaped into the wild.
"The design of SQLite was inspired by the design of TCL, both in the way it handles datatypes and in the formatting of its source code. The index use case for SQLite was in a Tcl/Tk application for an industrial company. From its inception, SQLite has always depended heavily on TCL. These days, SQLite no longer uses TCL internally and can be run separately from any TCL interpreter, and yet the SQLite development process still depends heavily on TCL."
[1] https://www.tcl-lang.org/community/tcl2017/assets/talk93/Pap...
Tcl itself was quite clever as what I'd actually call a string-based scripting language (contrast with Bourne/C-shell/etc. that preceded it on Unix).
Originally, Tcl was among the handful of off-the-shelf extension languages. You write your big application in C or C++, and then you embed an interpreter for a higher-level extension language, for users or the original developer to add on functionality. The options at the time were usually a small Lisp/Scheme, Tcl, Python, or something entirely bespoke and probably quirky and half-butted.
During early dotcoms, there was considerable interest in Tcl for backend work, and it also wouldn't have been the worst choice to put into the browser. Like Python, Tcl would've been more accessible and democratizing-the-Web than JavaScript, and there were already solid off-the-shelf designs and implementations. (Scheme would've appeared slightly more intimidating than Python or Tcl, and was more powerful, which I think was why Tim Berners-Lee preferred Python over Scheme as the people's programming language for various Web purpose. The semantics of the JavaScript we got was more a hurried toy Scheme, plus the simplest object model, and a more intimidating syntax that came from systems programming.)
Didn't Cisco use Tcl in one of their IOSes? Found it: https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ios_tcl/co...
You're not that old, are you? :) Before www, expect was the way to go.
I loved it back in the day, tons of fun to configure with code, somehow friendly enough for me to play with in high school with no background knowledge and only some man pages to help me. Coupled with a lightweight WM like CTWM https://www.ctwm.org/index.html it lead to a really performant desktop on the single-core ~400mhz machines we had in our computer lab....
You cannot encode arbitrary tcl data to a typed object "correctly" because every tcl dictionary is a valid list, and every list is a valid string (numbers are also strings, and so is code). So in a world of "tcl code on the web", both the sending and parsing ends of a 'tcl data stream' would need to know which type they're "supposed" to treat the data as.
I do sometimes yearn for the alternate universe where web browsers ended up doing Python natively (and PyPy style optimizations became the default, and the dynamism was reined in to an extent where it could offer JavaScript-tier performance).
Aside from the emphasis on "continuation passing style" though I don't get how you're relating JavaScript to Scheme.
Develop Cross-Platform CLI and GUI Tools with Tcl/Tk (cgicoffee.com)
112 points by aryonoco 29 days ago | hide | past | favorite | 62 comments
https://news.ycombinator.com/item?id=49515662Good to see it's getting some modern support.
Some things I've tried/looked into (beyond TCL/TK):
- Gambas --- Linux only, not sure if there's a nice visual UI builder
- LiveCode --- still salty about the license rug pull, wish the openxtalk folks could get some traction
- MoonBasic --- looks promising, but currently trying....
- flet.dev --- the AI-integration in this makes it quite compelling, though I wish that there was an integrated UI drawing tool, https://github.com/raffieeey/Flet-Visual-Builder is self-described as buggy and hasn't seen an update in 7 months
- Lazarus --- still bummed I never got anywhere with Delphi --- if flet.dev doesn't work out, may try it
VB + C# with Windows Forms is not much different from old school VB.
And for the pixel positioning complaints, it is about time people learn about FlowLayoutPanel and TableLayoutPanel, they exist since .NET 2.0 (2005).
And it shares a lot of the same metaprogramming that Lisps have - more so than the vast majority of other languages.
Classical Lisp (Scheme/CL) has much more elegant core concepts/semantics, but often much more clunky stdlibs and small/outdated batteries. This shows in unexpected places like the way homoiconicity has a big caveat: comments break the "code as tree" contract, forcing you to revert back to the useless "code as string" middle ages.
I know that because I had a need to hack together an horrible replacement for the thing I miss the most from Lisp: quasiquoting (https://git.sr.ht/~q3cpma/tcl-misc/tree/e4ba1bb4fcca729337b9...).
------
So, despite the fact that I'd probably recommend Janet to people who want Tcl without Tk, these days, I still like it. Do note that compared to its competitors (Ruby, Python, Perl), its POSIX support is _really_ bad. There's no way in core to do signal handling or open a UNIX socket (and dead TclX that doesn't use namespaces isn't a replacement). Even SBCL has sb-posix.
https://blog.gbacon.com/publications/2000-perl-journal-tktk/
https://newsgrouper.org/%3C119gpah$3eu5q$1@dont-email.me%3E (Tcl) and
https://newsgrouper.org/%3C119gpbh$3eu5q$2@dont-email.me%3E (Tk).
Kudo’s to Mr Osterhout’s long lived legacy
Tcl and Tk are fantastic, and if this is where it ended, John Ousterhout would have secured his place in history - this is only 1 piece of his contributions, though - see too:
* Log structured file system[0]
* parallel Make[1] (Adam de Boor from Sprite project, not JO hisself)
* RAFT consensus protocol[2]
* Various notable teachings [3][4][5]
[0] https://en.wikipedia.org/wiki/Log-structured_file_system[1] https://man.freebsd.org/cgi/man.cgi?query=bmake&sektion=1
[2] https://en.wikipedia.org/wiki/Raft_(algorithm)
[3] https://en.wikipedia.org/wiki/Ousterhout's_dichotomy
[4] https://web.stanford.edu/~ouster/cgi-bin/papers/threads.pdf
This is partially because when Tcl was first incorporated in VLSI tools it didn't have a good way to organize and modularize code. But this is also because the big VLSI tool shops realize they basically have a monopoly on their integration surface and have no incentive to improve it.
It's easier to freeze the integration surface and maintain backward compatibility than it is to move the surface forward.
But I think the Sprite kernel and the Sprite-specific libraries (Pfs, Pdev, Fs_Select, Td_), as well as the Sprite-specific userspace, were pretty incredibly pieces of software given the limited resources they were created with.
For that matter, John Ousterhout's text editor and terminal emulator, mx and tx, were the substratum that Tcl was built on. There's a single library on Sprite, libmx, which mx and tx are based on. Tcl basically grew as the command language of libmx, originally two separate entities, then by mx 2.4 it was fully incorporated:
eery@cherimoya [1] > cd /sprite/src/lib/mx
eery@cherimoya [4] > grep Tcl *.c
mxCmdAM.c: Tcl_Interp *interp;
mxCmdAM.c: Tcl_Return(interp, Cmd_BindingGet(mxwPtr->cmdTable, argv[1]),
mxCmdAM.c: interp->result = Tcl_Merge(bindingCount, bindings);
mxCmdAM.c: Tcl_Interp *interp;
[...]
eery@cherimoya [10] > grep LIBS ../../cmds/mx/local.mk
LIBS = -lc -lmx -lsx -lcmd -ltcl -lX11
Of course, even by 1992, there were multiple versions of Tcl coexisting... :-) eery@cherimoya [11] > ls /sprite/lib/sun4.md | grep tcl
libtcl.a
libtcl5.a
libtcl6.2.a
libtcl6.3.aHere's another plug for his book:
A Philosophy of Software Design/2e
The startup I joined in 1999 had its own application server loosely based on AOLServer architecture.
We had Apache + mod_tcl, IIS with our own ISAPI extension, then in box connections for all major RDMS across all key UNIXes and Windows NT/2000.
Some left to join companies doing Vignette projects, others eventually created OutSystems redoing the same ideas, but with the newly released .NET.
However it was also a lesson in performance issues, and the constant pressure to rewrite Tcl code into C extensions.
Was great for rapid prototyping and a/b testing in volume. Not sure I'd pick it ever again for anything, but it was interesting for sure.
Some throwbacks of his from 1999:
https://philip.greenspun.com/wtr/aolserver/introduction-1.ht...
https://philip.greenspun.com/wtr/aolserver/introduction-2.ht...
I remember being introduced to regex one day, and later the instructor (a Caltech PhD?) being surprised my code passed all his tests in a class review.
Really, a wonderful experience.
And I remember, after a day of learning Tcl, while waiting for an express bus back to Claremont, listening to a woman belt out opera on an empty Colorado Blvd in front of Vroman's, like a private opera rehearsal.
Such a classy city.
“Tcl tends to get ported to weird places like routers.” (Larry Wall, October 1997)
My next question to myself was what hardware was running Tcl in c.1997 Cisco equipment? What porting effort was required? I understand there was some proprietary feature work for Cisco IOS, but I don't know what architectural work was required.
And which gives us tailcalls and coroutines.
If you understand how generative models and agentic coding works, it's not a surprise. But for some reason it's still mind boggling to think that you can take very old stuff and build impressive programs.
It's a Lisp with syntax sugar and no macros.
For the simple prompt to Claude Fable:
let's write a small tcl/tk app for fun.
a small tiny UI to manage a to do list.
I got this in no time: https://gist.github.com/mathusiast/a57bf0dfa42d8c7008f8882da...One can not even find it on TIOBE but one can find COBOL there:
https://www.tiobe.com/tiobe-index/
(TIOBE is horrible, but still.)
[1]: https://redmonk.com/sogrady/2026/04/14/language-rankings-1-2...
The biggest reason to use Tcl even to this day is to write Tk GUI programs.
Well... Tcl on its own is good as a configuration language, creating DSLs, or as a scripting/extension interface, as well as a single common cross platform interface to filesystems, network sockets, and more - so I'd say "the biggest reason" depends on what you're working on...
I personally wouldn't put anything but Ubuntu on a computer that someone else has to use and I have to support. No Arch, Fedora, Suse.
The main reason is that I know it, how to configure it, and when it tends to do silly things. Secondary reason is that Ubuntu is a beginner friendly distro.
Unless you are familiar with Arch/Omarchy and/or have ideological reasons, I don't see the point of putting it on someone else's computer. If articles and videos are hyping it, they are probably wrong or don't apply to your case.
See: https://wiki.tcl-lang.org/page/GSoC+Idea%3A+Tk+Backend+for+t...
i'd expect sdl, given wider platform coverage (e.g. mobile), more system integration (e.g. clipboard), and an existing port (https://androwish.org/home/dir?ci=trunk&name=jni%2Fsdl2tk)
I ended up really disliking tk.
Using ruby-gtk2 and ruby-gtk3 was much nicer. (Sadly, gtk4 sucks, so that's the end of the story there.)
I kind of want a universal toolkit that works everywhere and is also good. Right now I use ... well, either the web (that's ok, though I hate how I can not easily open local files and so forth, without having to use node), or swing via jruby-swing - which semi-sucks, but it also works on windows and it actually is not that bad. (I could use javafx etc... but it is so much easier to get started with swing). I also use libui-ng which is ok but lacks many features, sadly.
..... but they do not come with Next Scripting Framework.
There was a new release on September 16, 2026
Also https://cgicoffee.com/blog/2026/04/tcl-tk-develop-cross-plat... (takes a little time to load).