3 ms·
Tcl and the Tk Toolkit, 2nd edition
- davidw 17y ago"My" book is out...here's part of the story behind it.
- cturner 17y agoCome on, bring out your romantic war stories. Tell us about your favourite epic one-liner.
- mikeryan 17y agoI don't have an Epic one-liner but back in the day we used Vignette StoryServer with Tcl as the scripting language. By some weird tweak that AFAIK was unique to that system in order to escape a square bracket in a string we had to add 2^x backslashes for however many square brackets deep we were. So you'd end up with something like puts " page \\\\\\\\\\[8]"
- buro9 17y agoI hated that, made making common libraries a PITA. Sure there were workarounds but it was definitely a gotcha if you knew TCL prior to Vignette and were suddenly faced with Vignette messing with you.
- wsprague 17y agoI really like Tcl/Tk, and I hope anyone wanting to hack together a quick GUI interface gives it a try!
- gaius 17y agoTcl is an incredibly underestimated language. The Ruby guys go crazy for Shoes; Tcl/Tk had Starkits years ago which do way more. Concurrency is all the rage - see how efficiently the Tcl VM can run as many interpreters as you want (tho' you can have threads if you want them too), forget Python's GIL. The Lisp crowd talk about macros as their killer advantage - Tcl makes adding new constructs trivial (everyone implements their own do...while in a few lines of code). Distributed computing - Tcl securely exchanges Tcl scripts as easily as data, send some processing off and get it back, or build a rich GUI control on the fly and send it to someone's screen, it'll run there and send only the data back to you. I never understood why Tcl wasn't wildly popular. Even now it suffers from a reputation as an "old" language, when its VM is up there with the best of them.
- davidw 17y agoBad marketing, mostly. But that's another topic for another time. Suffice it to say that wondering about that very thing helped me to learn a lot about marketing and economics.
- makecheck 17y agoI think Tcl is ideal for writing domain-specific formats, e.g. file formats that require a few custom constructs but would still benefit from essentially an entire programming language to help with specification. I also think Tk is a major strength, though I always preferred Perl's interface to it. Despite these strengths, I don't like Tcl as a language. It's not that its syntax isn't without certain charms (brevity being one), but it has a few flaws that I consider fatal: 1. It is far too easy to make the mistake of inlining a list. This can result in arguments being passed in the wrong order, or partial lists being processed when it "seems like" the whole list has been read, etc. This is a very hard problem to debug. 2. The Tcl interpreter does not trace blocks very well. It usually points you to the line of the last curly brace in a half page of nested constructs, which tells you almost nothing about where an error is. 3. While it's very easily bound to C, it has no concept of objects. So Tcl APIs seem to require constant re-querying; for example, rather than "set x [expensive_get_operation a b c]" followed by "[x do_y]" and "[x do_z]", APIs tend to look like "[expensive_y a b c]" and "[expensive_z a b c]". All other advantages to objects are, similarly, lost. Of course, Tcl has been evolving fairly rapidly lately, and 8.5 addressed a number of serious annoyances. Maybe my perception is out of date; if so, please enlighten me.
- davidw 17y ago8.6 includes some OO stuff: http://www.markroseman.com/tcl/guide86.html http://www.markroseman.com/tcl/guide86.html And of course, different OO systems have been available for a while. One of the 'bad marketing' points is that having different, competing, not-installed-by-default OO systems available might be fun for people to play with, but is not fun for end users who just want to pick one and be done with it.
- systems 17y agoTcl has its faults. 1) Poor DB support (TDBC is very young with so few drivers) 2) No CPAN 3) Poor support for web-development 4) Poor support for advance programming constructs 5) Dry community Its not just Marketing, Tcl is just not as exciting as Haskell, Erlang, Ruby or even R!