Tcl Tutorial
tcl-lang.org
tcl-lang.org
Project languished due to my attention span running out, but I still have my adaptations of those codes on my drive, in case I ever pick it up again.
That is to say, its packages are Tcl.
I haven't used it in many years, as is has been largely replaced by Homebrew, which uses Ruby.
(I once maintained a MacOS port of a good-sized scientific analysis package. Hundreds of MacPorts packages, I have debugged.)
I like MacPorts, but most macOS using developers I’ve conversed with over the past 12+ years never heard of it, while all of them used Homebrew. Maybe it depends on what developer circles one inhabits.
I’ve dabbled in BSD before and I can definitely see the correspondence between Macports and freeBSD ports. I assume homebrew tries to be more similar to apt or yum.
Takes forever to compile stuff on a G3 though :)
But, by all measures, MacPorts is more standard than Homebrew. Such as being implemented by an Apple employee who also created the official (source-based) package manager for the most popular BSD.
Homebrew definitely has a lot more market share though, much to my chagrin. The only other MacPorts users I’ve met in person are people I convinced to switch.
No, it's not. macOS does not have a standard package manager.
case aptItem
case brewItem
case nugetItem
case yumItem
>:(This made it easier to adapt large collections of packages to new versions of macOS. Or to adopt the latest version of a package. Easier for integration testing for my application.
It doesn't surprise me at all that MacPorts has a larger collection of packages than HomeBrew.
My other ride is Gentoo Linux. :-)
https://modules.readthedocs.io/en/stable/modulefile.html
Though there is a replacement that uses Lua which is somewhat better than TCL:
https://lmod.readthedocs.io/en/latest/index.html
TCL is also pretty universally used in EDA scripting. It's pretty bad, though I guess it is better than all the Bash that EDA devs tend to use too.
Its popularity led it to being ported to other languages, Perl & Python being the big ones, but TCL Expect is the og
Package owner: "These configuration choices are so important that a human must be present at the keyboard every time, without exception. Woe would befall us all were the will of the ancients ignored. So it was written, so it shall be done."
Me: "Yeah, nah."
https://www.tcl-lang.com/software/tcltk/9.0.html
Any word on a nice binary release of it?
tkcon gets you reasonably close to a GUI designer, it is text mode but instantaneous, and quite simple to configure the widgets to allow you to configure them with your mouse if you really want to do that.
I am probably going to have to break down and learn/work with QT or something similar for the graphical project I am planning out and have been searching for an environment for.
I use TCL often (forced to) since it's Cloverleaf Integration Engine's official scripting language and it works very well, but it is different from other languages in that its syntax is not modern, though, it's not difficult to learn if you really need to.
It's an older language that's fallen out of favor mostly for other scripting languages (Javascript, Python, etc) and understandably so. I'm by no means an TCL, but do consider myself an expert when using it with Cloverleaf.
Thanks!
What I would recommend right off the bat is installing the handy tool `rlwrap` and starting `tclsh` using the command `rlwrap tclsh`. This wraps it with readline which imo is a better experience (especially if one is used to the readline keyboard shortcuts).
But to be honest, while I feel like Perl has a lot of advantages (full perlre, full access to POSIX APIs, slightly better performance), I still can't look at it and keep my last meal down. Tcl having an event loop and Tk being native are pretty nice too.
It’s not quite “complete” with respect to all the usual LSP features (just does linting and formatting for now), but it’s a starting point!
That means it's a good language to extend your program. I don't know how it compares to Lua, which seems to have replaced it in that space.
But then - isn't that the case for other scripting languages these days? Or are they too complex and with "strings attached"?
Perl is a nightmare to interop! They should have won an award for that. It took effort.
Python is slightly cleaner than perl, but not much.
I'm also a big fan of the full-fat Tk-capable Tcl in Altera's SignalTap / Virtual JTAG - I used it recently to plot histograms on-demand for profiling RAM / Cache accesses.
Our flow is thousands of lines of Tcl code around all the cadence and synopsys tools. Then we write more Tcl to create the power grid, create blockages, etc.
a + b
in Tcl its
expr $a + $b
thats my only beef.
$ rlwrap tclsh
% namespace path {::tcl::mathop}
% + 2 4
6
% - 6 1
5
% - [+ 6 3] [+ 1 1]
7