Version 43 of Tcl/Tk/Talks

Updated 2009-04-08 20:00:32 by wws

This is a page for me to outline a 45 minute talk I am giving this summer on Tcl/Tk

Talk Overview

  • 45 minutes total
  • Sophisticated audience
  • Unix users
  • Skeptical about Tcl/Tk

Things does great

  • GUI
  • Event loop (file + sockets + GUI)
  • Deferred evaluation
  • Portability, especially across unices
  • Template with subst
  • C integration

Complaints -- some fair, some no longer accurate, some due to ignorance

  • Syntax is weird: non-Algol (ignorance)
  • Slow (no longer)
  • Syntax is weird: names/ values versus variables (ignorance)
  • GUI's look weird because of motif commitment (no longer)
  • Visual programming tools (true)
  • Object orientation (no longer)
  • Libraries (true -- need a libraries project)
  • Bad apache/ webserber integration (true -- sorry tclhttpd and rivet)
  • Not cool like Java/ Ruby/ Haskell/ etc (true, but silly)

Demos

  • Hello World button, counting buttons
  • fifo/ barcode event scanner thing
  • tksed
  • postgresql over ssh

Possible new niches

  • Castoff unix boxes + custom doing appliance type work, e.g. counting guests at a soup kitchen with a keystroke "A" for adult, "C" for child, etc, and uploading the results somewhere useful
  • Simple interactive scripts, e.g. deleting files one at a time quickly (with a keystroke) after reading short info about thme
  • Medium size applications like gitk and tkdiff
  • Applications driven with a lot of custom callbacks like eggdrop
  • Lots more Unix machines around and they need a visual scripting language
  • Makers should be driving their things with Tcl/Tk
  • Templating language for apache (using something more like direct subst, not the rivet/ PHP knock-off syntax)
  • New programmers (change through cohort replacement)

Skeleton/ recipe for moderately complex (200 line) visual script

  • MODEL array
  • upvar proc's as callbacks
  • traces to update widgets
  • fileevents
  • vwait
  • overall code layout -- commenting style, code sections, etc.

Notes for using this later

  • All user groups need speakers -- hint, hint
  • Feel free to update, use, comment on successes and failures, etc

Links

http://opensourcebridge.org/events/2009/proposals/24

http://tcl.projectforum.com/roadmap/Home

http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/d6f ...


Challenges

  • Deployment
    • how is deployment a challenge? Of all the languages on the planet, Tcl is about the only one that has this one nailed because of tclkits, starkits and starpacks.
      • Recently it is not shipping on standard installations, like Free Geek's Ubuntu.
      • Also, I think the starkits whatever is a little confused still
  • Libraries (the community needs a Tcl/Tk library project)

Fabricio Rocha 08-Apr-09 - Hello, Webb. As you said you would like to have some comments from the community, I would like to suggest you some things. In the "complaints" section, I think that the lack of visual programming tools is a candidate -- even though lots of people think that Tcl/Tk is so simple that it would not need it, those tools are usually expected nowadays (I am actually getting my hands dirty with that, but it's a long way to go). Also, if the "complaints" section is something like myths-to-destroy, maybe you could mention the Tk's Motif trauma which is still so-much spread, and present Ttk as the current answer. And in the "things done great" section it would possibly be good to mention the above-average portability Tcl/Tk provides.

By the way, "granpa might be old, but he can still kick your ass" was great! :)


RS 2009-04-08: Re "syntax is weird", see Why is TCL syntax so weird. In fact it's the most regular and systematic syntax (one might debate whether Tcl surpasses LISP here).


D. McC 2009 Apr 8: Easy to learn (for the most part); the most English-like programming language; not slow any more, even in terms of machine time, and often superb in terms of human time expended to get good results.

"GUIs look weird" isn't nearly as true as it used to be, but Tk/Ttk at its best still doesn't look as good--and isn't as easy to make look good--as GTK+ at its best. (At least, I think so, and I'm pretty sure I'm not alone.) A possible solution: gnocl now (in version 0.9.94) has attained a great deal of the functionality of Tk/Ttk, and combines the ease, versatility, and rapid results of Tcl scripting with the good looks and easy "themability" of GTK+. For those used to Tk, gnocl geometry management and widget commands take a bit of getting used to, but in some ways they're actually even easier than Tk.


WJG 08-Apr-09 I think that Tcl/Tk/Gnocl are the best kept secrets in the Opensource community. To be frank, Tcl is in great danger of becoming the "Rover" of the programming world. (For non-Brits Rover was a brand of car made in the UK which, in spite of its technical excellence, "died" because of the public perception of it. Rover was your "grandad's car", a motor driven by 60 year old men at 10 mph. Friend of mine lost their livelihoods because of such public predjidices. Let me ask, are the only users of Tcl old grey beards like myself or does it just seem like it?

If the age of the technology was the issue, then *nix's of any flavour should have been dumped a long time ago in the light of something else. But its still here, why? The excitement of it all. Fashion and public perception is everything. Godammit, just look at the QWERTY keyboard as method that should not have survived!

When I made my presentations on Tcl/Gnocl at LugRadio 2008 I patiently listened to a people struggling with Python and Perl and Gtk bindings saying thinks like, 'Oh, yeah. I've heard about that... antiquated language' and, because they wanted to feel 'hip' or 'cool' preferred to struggle on. Maybe that was the attraction? Tcl needs more passion putting into it, a champion, a voice, not a committe.

What is the strength of Tickle? Tcl. What limits its growth? The availability of support for other graphics packages.

Too many scripters spent their time trying to do wonderful, yet pointless tasks with scripts when the effort could be better put into tasks such as blogging, buildling bindings to other packages and championing and evalgenlising their preferred package. Just add some vowels to the name of the package, to make it more accessible. See what happens. If I were to capture the spirit of Tcl it would be to say: "Develop Once, Deploy Forever!". Use C to build packages and extensions and then script on and on....

DKF: FWIW, Rover died because they didn't offer a product that was good enough given the price they charged.

WJG: Beg to differ there. It wasn't a matter of quality, or price, but public perception. Its related to the 4 "Ps": Product, Pricing, Placement and Promotion. The first two were fine, the last two were not. They tried for something upmarket with an established name. Instead they ended up with a 'grandad car'. They should have gone for something less elite and used one of the many other brands that BMC (the ancient British Motor Corporation) aquired in the past.


JSB: For the “Things does great section”, I would add to the Event loop (file + GUI) line sockets. Sockets are one of tcl’s very strong and easy to smoke other scripting languages areas. A few line minimal web server would be a good example as well.

Tcl in the real world…… We see tcl and tk used so many times as a starting point for a project or program. It’s been that way for years. Someone needs a quick GUI app, etc and they find a tcl/tk example on the web…. It looks easy to use so they code away and get it to work. Then they go to the book store, talk to their friends/other co-workers or do a google search and see that “tickle aint cool”. The fact that their app was easy to write and maintain and that tcl did a good job for what they wanted and needed is forgotten. Within a smallish amount of time, the code is perceived to be “bad” and needs to be re-written in one of the cool languages. All of their positive tcl experiences are long forgotten.

BTW - Are there any autos made inside the UK still? Pitty if not :( WJG Just watch F1 motor racing! And then of course motors such as Lotus, Aston, Jensen, Bentley, Rangerover, Morgan, McClaren... all pretty **cool** motors, just none them for grandads! All are pretty slick motors and promoted well.


AMG: People like to complain about Tcl variables being weird, about how it's tough to remember when a dollar sign is needed. Well, I think Tcl is much more regular in the way it handles variables than languages like C (sometimes need a & when referring to the variable instead of its value) or PHP (always need a dollar sign), where context determines whether to act on a variable or its value. Context can be a complex thing to figure out. For example, in C it makes a difference if the variable is an array: the "value" of an array variable is a reference (pointer) to the variable. And in C++, parameters can be passed by reference as well as by address or value.

The only "problem" with the way Tcl does it is that it's different than many other languages. The benefit is that it allows the programmer to quickly distinguish between a variable name or variable value, without examining context.

  • The way I am think about is that there are two levels in Tcl -- names of things (referencers) and storage of things (referenced). In most languages, the reference is transparent and yields the referenced thing immediately; to prevent this, you need to quote. In Tcl it is the opposite. I think this is a really deep difference, automatically making Tcl more reflexive and self aware, in a funny way. I think Tcl is better -- the question is how to explain.

AMG again: Maybe do a side-by-side comparison of C and Tcl and show how Tcl exhibits a more predictable structure. Something like this:

C Tcl Comment
int a = 5; set a 5 "a" is variable name
int b = a; set b $a "b" is name, "$a" is value
int *c = &a; set c a "c" and "a" are both names
char *d = "a"; set d a names are used instead of pointers
int e = *c; set e [set $c] [set] can take value of variable with computed name
int f[] = {a, b, *c}; set f [list $a $b [set $c]]] [list] makes lists
printf("%d\n", a); puts $a no need to specify format; everything is a string
printf("%d\n", *c); puts [set $b] [set] can access or modify value of variable with computed name
printf("%s\n", d); puts $d names are used instead of pointers
printf("%p\n", &b); puts b names are used instead of pointers
printf("%p\n", c); puts $c names are used instead of pointers
printf("%p\n", &c); puts c names are used instead of pointers
printf("%p\n", f); puts f names are used instead of pointers
printf("%d\n", f[0]); puts [lindex $f 0] [lindex] extracts elements from a list value

But first you must show how commands are used instead of syntax.

  • You do know I am a Tcl user and believer, right? For the talk, I thought I would probably show a quick command, but go into some detail about the syntax, since these should be fairly sophisticated computer folks.

AMG: I'm not trying to convince you. :^) I'm just trying to offer you examples that may help you to educate others.

KWizzz 2009-04-08: I think you should also mention Tcl's stubs mechanism. This is what it sets it apart from languages (just look for libraries that are available only for Python 2.6 -- while Python 3.0 users still have to wait for them). With Tcl, I can simply upgrade to a newer version and enjoy dict or the new oo features while still having access to all the libraries. Hm, I also like the Starkits for -- more or less -- easy distribution of Tcl programs.

WWS 2009-04-08: If someone wanted to give me an explanation of stubs and starkits that I can use to a tough audience, I would be into it, but I don't think there is time and I don't understand them anyway.