4 ms·
Unrelated but genuine question: what's the appeal of Tcl nowadays? are there applications where it'd make sense to use Tcl?
by yodsanklai 9y ago
Unrelated but genuine question: what's the appeal of Tcl nowadays? are there applications where it'd make sense to use Tcl?
- forinti 9y agoWith freewrap, you can make a standalone executable for Windows. You won't need to install a VM on your user's machine. The last app I built like this was a graphical front-end for joining PDF files with Ghostscript (choose files, choose destination, press go).
- ghettoimp 9y agoIt's a truly awful language. For some reason it's used by a lot of CAD/EDA tools (hardware development), so if you're working in that ecosystem it's often all you've got.
- slrz 9y agoRight, Tcl is the lingua franca of EDA tooling. People just expect that you can talk to it via Tcl. It's often the only way to automate design flows, so you better get used to it. Tcl is actually pretty decent as a language, very elegant in its utmost simplicity. I don't get the bashing here.
- ghettoimp 9y agoI didn't realize that this would come across as senseless bashing. My main complaints against TCL basically center around the everything-is-a-string mentality and the corresponding lack of type safety anywhere. A more minor objection is that I strongly dislike the syntax for numerous reasons, such as - Comments aren't like any other language and have numerous gotchas, e.g., you can't use mismatched {}s in a comment within a proc, - Whitespace is relevant in surprising ways, such as requiring Egyptian brackets for procs/ifs, and I constantly forget line continuations - Using foo for lvalues but $foo for rvalues, while sensible, is a constant source of typos... but, of course, you do get used to it. Mostly. But the comment thing really irks me. I will certainly agree that you can do worse. TCL is surely a fine alternative to awful shell languages (bash, C shell, etc.) But in the realm of dynamically typed scripting languages, I'd absolutely nominate Python or Ruby as a much more reasonable and sensible for your everyday programmer, and Lisp's S-expressions seem far more elegant if you insist on a unifying principle like everything-is-a-...
- isr 9y ago> It's a truly awful language. If you use it like, say, perl, then yes - some of the code looks horrible. If you take a step back, really try to grok it, and then use it like a lisp (but for strings, rather than linked-lists), then its actually quite elegant (with sometimes messy indentation). If you take another step back, glance sideways, look at every other unix shell, then look again at tcl's "undefined cmd" behaviour, the exec cmd, its inherent lispiness (see above) ... ... then you smack yourself on the head when you realise this is yet another defeat grasped from the jaws of victory. Tcl should have replaced bash et al. Especially so for jimtcl (a lightweight reimplementation of tcl, started by the redis author).
- tyingq 9y agoWhen it was popular, the 2 big drivers were: - The cross platform UI, Tk. Even if you didn't like Tcl, it was, for a while, one of very few open source ways to get a UI that worked on a variety of platforms. Many things, mostly the web, killed this need. Also, there are Tk bindings for other languages now. - Dead simple, lightweight, way to embed a user facing scripting engine into your application. Especially when the end user might be "technical", but not a developer by trade. This is still a need, but it looks like people are turning to Lua, Javascript, etc. Tcl is still embedded in a lot of hardware devices though...cisco routers, F5 load balancers, etc. Edit: Related trivia. TCL's inventor, John Ousterhout, was also one of the co-creators of the raft consensus algorithm.
- moomin 9y agoThe thing is: I know what I think of TCL now, and I know what I thought of it at the time. They're pretty different. I think ultimately we've come the conclusion that whole design space isn't that productive. Pervasive string expansion in an era of untrusted input probably killed it for the web before it even began.
- kazinator 9y ago> Also, there are Tk bindings for other languages now. However, these drag in the entire Tcl implementation as a dependency. IIRC some of the ttk widgets are written in Tcl, at least partially: https://github.com/tcltk/tk/blob/master/library/ttk/treeview.tcl https://github.com/tcltk/tk/blob/master/library/ttk/treeview... It's a very ugly thing; I'd never drag this into a programming language as a prominent "this is the go-to way to do UI listed in FAQ #3" package. You really want to confine a Tcl/Tk UI to its own process so all that string churning is happening in its own address space.