4 ms·
I spent a lot of time with Tcl, first at company some friends and I started in the late '90s, and then at Arbor Networks, where I dragged it into their service
by tptacek 9y ago
I spent a lot of time with Tcl, first at company some friends and I started in the late '90s, and then at Arbor Networks, where I dragged it into their service provider product.
In a Lisp, code is trivially parsed because everything is a tree of conses, and the language derives tremendous power from that.
In Tcl, code is trivially parsed because everything is a string, and the language is hamstrung by it; it's a little like trying to code a major project in Bourne shell.
For a time, Tcl had the best C integration story of the scripting languages, with a thoughtfully designed extension interface that was easy to use. But every major scripting language has that now.
Tcl was early to what I guess I'll call mainstream metaprogramming (obviously, Lisp got there first) with "upvar" and "uplevel" and [incr tcl]. But Ruby --- which bears a lot of similarities to Tcl --- did all that stuff much better and more cleanly.
- deleted 9y ago[deleted]
- davidw 9y agoThings are a little bit more nuanced than 'everything is a string', since you can create types that are other things. I think this comment gets at that in a fairly accurate way: https://news.ycombinator.com/item?id=14943844 https://news.ycombinator.com/item?id=14943844
- mncharity 9y ago> a thoughtfully designed extension interface that was easy to use. But every major scripting language has that now. OP> Easily embeddable/extendable. Easily embeddable language implementations have regrettably remained more uncommon. Sure, extending has gotten relatively easy, but it's still in that "we own the world - you are welcome to visit, as long as you fully respect our partially-documented memory, stack, io, threading, whimsy, and other disciplines" kind of way. And "feature: we're embeddable! (sort of, if you're careful, sometimes, maybe)" toxic hairballs of surprise are still a thing.
- rbehrends 9y agoExactly. Tcl competes with Lua, not Python or Ruby. And Tcl and Lua both have their respective advantages and disadvantages. - Lua has better support for handling non-trivial data structures, but Tcl interop is a lot less cumbersome, as the host language only needs to know how to pass strings back and forth, basically. - Tcl is more suitable for writing DSLs due to its homoiconicity, but Lua's more conventional syntax is more suitable for traditional programming. - Tcl's command-oriented syntax makes it fairly easy to write an expressive shell-like interface for your application (debugging, state inspection, expert interface). I'll note that via JimTcl [1], Tcl also has an additional niche for bootstrapping software as a much saner replacement for /bin/sh programming, such as in autosetup [2]. [1] http://jim.tcl.tk/index.html/doc/www/www/index.html http://jim.tcl.tk/index.html/doc/www/www/index.html [2] https://msteveb.github.io/autosetup/ https://msteveb.github.io/autosetup/
- mncharity 9y ago> But Ruby [...] did all that stuff much better and more cleanly. But it's taken Ruby a lot of years to get there. And even now, I'd suggest Ruby's `refinements` need more maturing for it to be clear. "uplevel" was wonderfully powerful for creating DSLs, even if rather sharp-edged to develop with.
- inopinatus 9y agoArticle feels like a blast from the past. I think Tk was the best of it. By 2001 I had ditched Tcl and was using Perl/Tk instead to fit simple UIs on in-house tools. Maybe we had some lingering expect(1) scripts for a few years after that.