Comment by JSR_FDED
8 days ago
I remember we had users at a chip foundry who were super deep into TCL. Is it still used anywhere else? Would you use it for a new project if you for instance already knew Python or Lua?
8 days ago
I remember we had users at a chip foundry who were super deep into TCL. Is it still used anywhere else? Would you use it for a new project if you for instance already knew Python or Lua?
Antirez (the author of this interpreter) uses it for the Redis test suite.
Personally, I know Lua and Python very well but I still used TCL a few years ago for something very specific: using ODBC on Windows. I gave more details on the Lua mailing list here: http://lua-users.org/lists/lua-l/2021-01/msg00067.html
That was interesting to read. So in your case it came down to ecosystem depth, especially on Windows - where there was a TCL solution to talk ODBC, but the equivalent Lua functionality had issues on Windows.
Tcl/Tk to this day is the best tool to make GUI frontends for CLI applications. Besides that, in the past I used it in production for intranet database entry applications. It has since been replaced by Flask. In my opinion the higher complexity of the Flask version is no way justified and we should have kept the much simpler ~2k LOC Tcl/Tk solution.
In the 1990s, entire GUI applications would be written in Tcl/Tk -- not just the frontend -- the entire thing.
>Tcl/Tk to this day is the best tool to make GUI frontends for CLI applications.
Why? Please elaborate. I've heard others say this, but would like to know more.
>Besides that, in the past I used it in production for intranet database entry applications.
GUI apps?
> Why?
CLI applications typically read text from stdin and write text to stdout. The tcl model of "everything is a string" makes exactly the right abstraction to create GUI frontends for CLI applications rapidly and keep them simple at the same time.
> Why? Please elaborate.
Tk's GUI object model is sitting at a reasonable maxima between trivial to make use of vs. triggering the events necessary to make the GUI active.
Small example. You want a button on your GUI that triggers a procedure called "process" when it is clicked, this is the code you need (if you are fine with the remaining defaults) (and assuming you used 'pack' as the geometry manager):
And a fully active GUI button will now appear at the bottom of your Tk window, with a label of "Process Entries" and when you click it, a Tcl procedure named "process" will be executed.
What is the best and easiest to install binary distribution?
I was looking into this for v9 and gave up on finding a binary which was:
- easily found
- agreed upon as the one to use
- available for and easy to install on all three platforms
Should I look again?
https://github.com/teclabat/tcltk-binaries
For jimtcl (the production-ready minimalistic tcl implementation which antires started (with full closures & gc'able lambdas) - probably an outgrowth of picol), you can get static "(some) batteries included" binaries at:
https://github.com/dbohdan/jimsh-static
For full tcl with the kitchen sink, bathtub & shower included, for android (hence the name) & regular Linux:
https://androwish.org/home/home
By the way, I'm guessing that Tcl was (is?) big in EDA because John Ousterhout also wrote the EDA tool Magic.
https://en.wikipedia.org/wiki/Magic_(software)
Tcl's first "release" was in 1988 and Magic was released in 1984, but it seems like John Ousterhout then wrote Tcl to have a common interface across tools [https://web.stanford.edu/~ouster/cgi-bin/tclHistory.php]. It still is a big thing in EDA, because (in theory) it lets a chip designer run their designs by tools from different vendors
It is at the core of the SQLite test suite and also a first-class citizen in interfacing to it.
It's still the lingua-franca of ASIC/FPGA/Simulation, especially for scripting the tools.
I think it's slowly being replaced there by Python, but it's very slow.
> but it's very slow
The process of replacing Tcl, or Python itself?
I like tcl as an alternative to shell for any non-trivial scripts.
And its coroutines + built in event loop makes for really nice seamless async style programming.
It is still used for operations procedures in, at least, European space industry. E.g., in mission control systems from Terma (CCS5 and TSC).
The MacOS hex editor HexFiend uses Tcl for its template language.
> https://github.com/HexFiend/HexFiend/blob/master/templates/T...
The previous company I was working at had quite a lot of TCL code for their back end logic. Betting sector, well known in US and Europe. They still actively hire people to maintain the codebase. Rock solid code, no surprises, was able to handle tens of thousands of concurrent bets.
We've got Check Point Firewalls at work, and during updates I see lots of .tcl in the web UI.
I'm looking to use TCL for an embedded platform, as the scripting shell. Its simplicity and small size is key, as is its easy integration with C.
i like calling a function f without arguments simply as
f # first word in TCL command line is a command
rather than
f ();
if there was also a function called g, i like to do things like
set a f
$a # calls f
so i can now
set a g
$a # calls g
cool i think.
I recall my time in satellite control systems had a lot of TCL code.