Tcl Tutorial Discussions

Discussion about resources for Learning Tcl

I'd like to take on the task of sorting through as many good Tcl Tutorials as we can find, and building clear way for someone who is not currently a Tcl'r to join us and find the information geared to their level of programming skill. It should be presented in a communicative, nurturing atmosphere that brings both the joy of Tcl and the fun of the community.


11 Mar 02 Time for me to get back to this. I've separated the intro above from the historical below. In this section will be the start of the pages. I'd like those of you who feel inclined to add or comment on the resources we point to. This is especially important for those of you who are serious programmers. It's not my background, and I don't really know what draws those sorts of people.


5 Dec 01 Below I've pulled some questions and responses together. My thanks to the folks who answered! I had thought to summarize and point out common things in the answers. But the responses were too good to edit, some were educatingly verbose, others were simply to the point.

As you read, mull over what it says to you. We have many, many years of experience speaking, and the community is mentioned more than once as being a main part of the joy of Tcl.

However, I wonder that the answers were not from people who have only been using Tcl a short while. Or they are not skilled programmers. Although this may be from the forums this page was introduced (The Wiki Chat). I need to expand the audience a bit, and hopefully existing answers won't affect the newer ones too much.

6 Dec 01 More answers are coming in! Great! One person wrote me and apologized for doing it "the wiki way", that is, adding stuff in place instead of sending me the e-mail directly.

The original plan was to collate the responses and bring back trends. However, the people who have answered have said better then I ever could what is great about Tcl. Just put three dots "..." after the last entry in the question, and share your mind with us. If you e-mail directly I'll post for you, and send you a thanks as well.

18 Dec 01 Well, here are some thoughts I've come up with.

Assumptions:

  • The people we hope to assist with these discussions are somewhat similar to the way people answered the survey.
  • We can interpret this data and make our tutorial(s) more effective through that interpretation.

What drew you to Tcl?

  • The GUI capability of Tk
  • Simple yet powerful
  • Cross-Platform
  • Mission Critical Power
  • Curiosity

What keeps you with Tcl?

  • Community
  • Support of developers (another aspect of community)
  • Quality of Language
  • Adaptable language
  • Ease of use, Fast results

Describe your current level of skill and amount of experience, both with Tcl and other programming languages.

  • High levels of Tcl and *many* other languages
  • High skills in C
  • A wide range of people like Tcl, but many who have been with it for years are still active in the community
  • 8 respondents listed years, for a total of 130+ years of experience

When you first started with Tcl, what did you think best about it? What made you think, "Oi, that's weird!"?

  • (like) Simplicity of language
  • (like) Easy to do powerful things like sockets
  • (oi!) How it handles Octal numbers
  • (oi!) Shimmering
  • (oi!) Syntax different from other languages

What resources did you use to learn Tcl? What resources have you used to learn other languages?

  • B. Welch book
  • John O. book
  • man pages/Win help
  • Source *cough*kkb*cough*
  • Professional publication, journal articles, community

What things draw you to learn another programming language?

  • Curiosity
  • Dissatisfied with current participation of community or commercial supporters

What resources do you currently use to stay current with Tcl?

  • c.l.t.
  • Wiki
  • communal examples (search, google, AS cookbook)
  • wiki chat

General Ramblings

  • No other language has a simple, native, powerful, GUI.
  • Tcl is a little weird in syntax, but once you've spent half an hour over that issue and a few more hours in general, you can do application development as advanced as your understanding of programming allows.
  • There are odd things that need explanation, but not enough oddity to qualify as "magic".
  • The community of private individuals is fantastic.
  • Commercial support, awareness, and acclaim is not as high.
  • Tcl-Tutor is only mentioned once as a learning tool, yet is is free, good, and has been so for some time. Marketing?

26 Dec 01 Okay, time to put some of the thoughts to use. I'm going to divide up the programmer community into several types, and then you can add to, correct, or disagree. The idea I have is to build the understanding of potential Tcl'rs, then use what we know (or think) about ourselves to build tutorials for each type.

Novice Programmer-- less than a couple years in languages, may be in college. Does not have deep C/shell correlations to Tcl. Needs:

  • Intro to TclTutor.
  • How to get and install Tcl.
  • Very short intro into how to do certain tasks, preferably GUI based.
  • Examples of powerful topics Tcl handles well, like sockets.
  • Demonstartion of the simplicity of the language.
  • Introduction to the Tcl community.
  • Intro to the syntax without notes on oddities.

Experienced Programmer--Understands similar languages, has produced working applications. Needs:

  • Tcl intro that deals with systax, keywords, and oddities.
  • Simple examples of powerful tasks.
  • How to get and read Tcl source.
  • Community resources for deep questions (wiki chat, c.l.t.) that can respond quickly.
  • Correlations between Tcl and other languages.
  • GUI application building.
  • Tcl-URL!
  • Professional publications showing tools built.
  • Ways Tcl has been adapted to meet a need.

Task Driven--usually aware of many tools for different jobs, needs some aspect of a Tcl extension quickly, not necessarily Tcl itself. (Tk/Expect). Various levels of programming skill, but generally better than novice. Needs:

  • Intro to Tcl syntax.
  • Intro to particular extension.
  • Cookbook.
  • Tcl FAQ, c.l.t. archives, Wiki search.
  • Community.
  • Books available.
  • man pages/win/help.

Here is the survey part

To that end I have some questions for the existing Tcl community. Also, if you have a question you feel pertinent, please add it!

Please note that references to "Tcl" include the core language and its extensions.

What drew you to Tcl?

Curiosity. used to do Fortran and C before. But after some Tk demo programs I felt I had to look deeper into this.

...

The power of an interpreted GUI, the Tk canvas in its extendability, the simplicity of the language, the joy of reading the Tcl/Tk source code.

...

I've been a computer language geek for years. I love to learn about different programming languages. But what really drew me to Tcl was the prospect of writing cross-platform applications -particularly GUI apps. I use Macs at home, and the idea that I might be able to write apps on Unix that i might also use at home on the Mac was/is appealing.

...

I first learned about Tcl when I saw John Ousterhout's paper announcing it at the 1990 Winter USENIX Conference.

   ftp://www.tcl.tk/pub/tcl/doc/tclUsenix90.ps

At the time, I didn't really understand the implications of an embeddable shell, and the proceedings gathered dust on my shelf. Later, in the Fall of 1991, I needed to do some quick-n-dirty GUI work, and a colleague lent me a copy of John's paper on Tk from the 1991 Winter USENIX conference:

    ftp://www.tcl.tk/pub/tcl/doc/tkUsenix91.ps

Since all I needed at the time was some rapid prototyping of some simple GUIs in a throwaway app, Tk looked like a good candidate, and I installed Tk 1.4 and whipped up my GUIs. One thing led to another, and within a few weeks I'd done quite an elaborate set of shell scripts and graphical prompts orchestrating a group of engineering application programs -- all, so far, without writing a line of C. John invited me to participate in a panel discussion of Tk users at the 1992 X Technical Conference, entirely without realizing that I'd been a user for less than two months!

With use of Tk as a graphical shell under my belt, I tried my hand at a little bit of application embedding, making what actually turned out to be an interesting little system of embedded application content, with hyperlinks joining Xess spreadsheets, FrameMaker documents, Tk GUIs and legacy engineering codes. The idea was to create "electronic design notebooks" to hold all the computer artifacts of an engineering design. Mind you, this was before the Web revolution! I submitted a position paper on this work at the first Tcl/Tk Workshop:

    http://titania.crd.ge.com/papers/gecrd/mtl/mdip/tcl93.ps

The program committee didn't see much in the work, but after the conference, it became something of an epiphany for John; it catalyzed his thinking so that he started seeing Tcl as not only a shell but also an integration platform:

    https://www.tcl-lang.org/doc/integration.html

(By the way, he credits me in the "Acknowledgments" section of his Tcl/Tk book as "showing that Tcl can be used to interface to almost any conceivable application.)

At this point, I still saw Tcl as primarily a prototyping vehicle. It wasn't until several years along the road that I realized that my prototypes were achieving production quality, and now I have some that run 24/7 in a mission critical environment:

http://www.usenix.org/publications/library/proceedings/tcl98/angelovich.html

...

I needed Expect. Then I wanted more maintainable GUIs than Motif. Then I figured out the simplicity behind Tk and Expect, and largely de-emphasized them just to study Tcl proper.

...

Initially- a recommendation that it could be used for rapid development- I wanted a prototyping language.

...

I first learned of the existence of Tcl when I read Boris Beizer's (for me classic) Software Testing Techniques. Later on I learned of commercial packages that used it and then I consulted a colleague about it. He leant me John Ousterhout's book and I was hooked.

...

Philip Greenspun's ``Database Backed Websites'' & AOLserver w/it's embedded Tcl interp.

...

Needed a simple Windows scripting language, was unhappy with Windows Script Host and (yes) batch files I had been using.

...

A purchased program my company is using had tcl as script language.

...

It was used a lot in my gap year placement for testing. The simplicity sold itself.

I interviewed for a job (that I didn't take) with a company doing OCR forms processing. They have large, complicated user interfaces that specify what can appear where on a form (say, an invoice), and these are written largely in Tcl. Customers, who often have little programming experience, can write the forms specifications themselves using a Tcl subset. They said they had a 5-fold productivity increase from doing the same thing in C++. Interesting - you never hear from them on the Tcl forums, but they're a big Tcl user.

...

I wanted to learn to program to do a specific task; I searched the web and tried several languages. I found a "Tcl Cookbook" and discovered that i could get things done. I also discovered that I could pick pieces of code from existing programs and use them on my program, even when I did't understand what they were doing. It was easy because it wasn't necessary to learn all of tcl, I could get by with just a few commands.

...

I haven't met a language that I didn't like, for one reason or another. While I have heard of it before, I have never felt the need to look into it. One day has come. -- DonaldNoyes

What keeps you with Tcl?

It's not the ideal language, but the best I've ever seen, regarding ease of use, user empowerment, rapidity of turnaround. And: the community, a small but powerful worldwide group, good for discussions and new ideas. I checked comp.lang.c and .python for a while, but just the tone wasn't exactly the same there. And the Wiki, allows me to make all my Tcl fun projects public and open for discussion...

...

See above, plus the friendly community.

...

Time invested. I've invested a lot of personal time, energy, and ego into the community. At times, I feel like giving up and moving on. But then, I look at other languages of similar ilk, realize how bad they are, and see that Tcl isn't as bad as I thought...

...

Tcl remains a superb integration platform. It can connect easily with code in other languages, in particular both C/C++ and Java. It also hooks up readily with components in the environment ranging from shell scripts all the way to COM, CORBA, and ODBC. Its notifier is also readily extensible, allowing scripts to respond to a wide variety of external events. The language is also simple in concept: its typeless "everything is a string" architecture is deceptively powerful.

Tcl also has a vibrant and friendly community. The amount of free support that I get from the Tcl'ers never ceases to amaze me.

...

I get results quickly. Perhaps even more than that, the people.

...

1- I learned that Tcl was capable of anything 2- Speed of development, flexibility, stability 3- Phenomenal developer community comp.lang.tcl 4- 3rd party app- TclPro/Komodo

...

At first I was impressed by Tk's portable graphics, but now I know that the power of Tcl is its ease of use, the simplicity of its syntax and the flexibility of the commands. Especially the regular expressions and string/list manipulation.

Something that is really useful to me is the way you can let data be Tcl code. Just write a proc with the same name as the first keyword and Tcl will do the hard part of interpreting the data.

...

It's a joy to work with. Things that would be so monotonous in other languages are normally fast & fun in Tcl.

... It is an AWESOME language. I absolutely love the instant feedback that scripting offers, and the multitude of packages out there.

...

More features than the default scripting language the product, mentioned above, has.

...

If Tcl doesn't fit my needs, I can adapt it so that it does. It is a language which can grow as my experience does. c.l.t and the wiki are great too.

One thing that definitely makes me want to use Tcl is the GUI development program vTcl. I can paste up an interface for a machine control console as fast as marketing can say what they want it to look like, and with a small library of communication procs it can be doing things within a day or two.

...

c.l.t.

...

I have to say that a huge part of the reason why I stay with Tcl is because of the community. The language is great and if it wasn't I would leave, but I'm truly passionate about the community. Everyone is friendly and even though I'm just a lurker, people on c.l.t feel like my friends. Every day when I read through the Wiki or the ng, I am guaranteed a few smiles.

Describe your current level of skill and amount of experience, both with Tcl and other programming languages.

Tcl - pretty experienced, but still learning new tricks. C - still able to write it, but do it only if I have to, so slowly drifting out of practice C++ - had a training course where I really got fluent, but no application on the job; when I look at C++ books, tutorials or so, I frequently think "Why does it have to be so complicated? just look at Tcl ;-)"

...

Programming: 25 years Tcl/Tk: 5 years

...

I've been programming since 1973 or so. I've programmed in BASIC, COBOL, FORTRAN, assembler on PDP 11 and IBM 360, PL/1, JCL, Unix shell, awk, C, Tcl, and piddled programming in Java, Perl, C++, ABC (predecessor to Python), Python, Scheme, and a number of other languages.

My preferred programming language is Unix ksh shell. My second preferred language is awk. My third is probably C and fourth is Tcl... I'd consider myself an expert in ksh, intermediate at awk, expert at c, and slightly higher than a novice at Tcl.

...

I can program at "guru level" in a number of languages including Tcl (I'm on the Tcl Core Team), C/C++, and Java. I have 25+ years of experience in the computer industry (ok, I started young 8^))

...

FORTRAN since the '60s. Deep experience with C, C++, Tcl, Perl, Python. Capable in ksh, Eiffel, Pascal, Ruby, Java, Erlang, Scheme, ...

...

Generally, I am a designer/developer with about 5 yrs. Of IT experience. 1 1/2 years, but have used most of the major packages quite a bit- I've done server development, client GUI's, Java and C++ extended apps, socket communications, and more- but I haven't gotten much into the C level of Tcl (rarely have to J )

Java & C++; Novice C & unix; 4 years- intermediate Oracle/SQL/other Db; 5 yrs- decent experience with both OLTP and OLAP systems Others....

...

C, Fortran 77/90: expert (10 years or more) Java: advanced (3 years) C++: novice (even after reading at least 4 books about it) Perl: ditto Tcl: expert (3 years)

...

Tcl (at the Tcl level): advanced. Tcl (at the C level): fairly succesful beginner. Tk: novice.

Once upon a time lots of: Basic & Pascal. Once upon a time some: Modula-2, & a little lisp. Never again!: Was learning Perl until I found Tcl, and then never since! A bit rusty: C (though I've dusted off enough of the cobwebs to write a couple of Tcl extensions for a project recently).

I've never had a desire to learn Java.

...

Modest C experience, lots of MATLAB and DSP assembly, some MS VB. Have used TCL for all of 3 months, and I have a SourceForge project already!

...

Fortran, years ago but I don't think I could write anything now. C for about 10 years. Java - novice to intermediate, csh - novice, rexx - intermediate to advanced, basic, pascal, TCL - weeks to months experience - novice but not for long.

...

I'm still doing my CS degree, so not huge experience. Tcling for about 2 years, same for Java. Before that BASIC and Z80 assembler on the Spectrum!

...

I have used tcl for about 4 years, but I still don't know how to program. When I need to write a script (that can be once a year!) I go back to the Windows help file and learn everything again...

When you first started with Tcl, what did you think best about it? What made you think, "Oi, that's weird!"?

One of the first points I liked were commonsense names like "string length". Tk of course, pipe servers with exec or open |..., list operations (I used to program Lisp in a former job life, so felt quickly at home) - the power of canvas - the commonsensity of reading images in XBM format, so I could supply them from C servers...

I liked Tcl since 7.4, and I started to love it from 8.1 when Unicode support was introduced, and I could do i18n *so* easily.

Took me some time to get the feeling for braces, and misbehaving comments... I still hate to see things like "set x [expr {round($x)}]"

...

Best: Only very few weird things Weird: Octal numbers, performance effects of shimmering

...

I used Tcl a lot without programming in it initially. I used apps written by others a lot, or talked people into writing code for me. I learned Tcl academically (by reading several of the books). Then I gave up and actually took several classes in Tcl, itcl, etc. over the years. What I like best about Tcl is how simple it is. What I think is weird is that it makes some things so much harder than it seems like they should be - trying to write code that in shell would be almost nothing takes more effort in Tcl - try to write a tcl script that takes the output from several tcl applications and massages it seems to me to take more work than it does for me to do the same thing in ksh.

...

What was best for me at the beginning was that simple things are simple. Tcl has less syntax even than the Unix shells, and Tk is wonderfully concise: the "hello world" program can be written as a single line of code:

    pack [button .hello -text {Hello, world!}]

For someone accustomed to the bureaucracy of user interface systems like Motif or InterViews (and the modern MFC and Swing are no better!) this simplicity was a breath of fresh air.

The "weirdness" primarily came from the implications of "everything is a string". For instance, the 'lindex', 'lappend', 'list', ... commands have a distinct Lisp flavor to them, and it took me a while to understand why I couldn't distinguish "lists" from "atoms".

...

I was amazed at how easy it was to set up a socket server and develop complete client server apps. It was so easy I was sure that something was seriously wrong. Then I was amazed at how easy it was to do everything I did.

...

The Tk demo was what amazed me (the code was staggering and incomprehensible though). As I have plenty experience with UNIX shell scripts, the infamous [set] assignment was not that strange.

The weirdest part to learn was how to organise the source code properly. And the strangest thing was to realise that you can do truly amazing things like redefining existing procs (even standard ones) and dynamical creation of variables, like global $varname.

...

The very simple rules & ability to redefine any command. I found (Tcl 7.4) lack of binary i/o & the treatment of octal #s to be strange.

...

I can actually get stuff done and see results in a matter of hours instead of days! Everything makes sense! Wow!

...

Sockets. Writing my first networked app (in any language) within a couple of days of first hearing of Tcl was great. $-syntax was a bit strange for me at first (having no experience with perl, or shell scripts or anything similar before).

What resources did you use to learn Tcl? What resources have you used to learn other languages?

Had a preprint (PS off the web) of Ousterhout and Welch books, later managed to get "real" hardcover copies (where I first heard of a thing called canvas ;-)

...

Tcl/Tk: John-O's book, Man pages, Windows help file

...

I started learning Tcl by signing up for a mailing list run by John Ousterhout. Then I worked with the group to get the usenet group created. I use postings there, web sites, tutorials made available on the net, a number of the books written, conference tutorials, and questions to specific people to learn more.

...

I think that C was the last language I learned from a book. C++, Java, Tcl, Perl, Haskell, ... I've generally learned from reading the primary literature (conference papers, journal articles, standards documents) and examining the source code of reference implementations. This method, by the way, is very successful with Tcl; the source code is copiously commented and well-organized, and it's a pleasure to read.

...

Chad Smith's book (incr Tcl), Brent Welch Book, and man pages

...

John Ousterhout's book, later Brent Welch's book, and of course the Windows help.

...

Initially, man pages, Welch's book, bboards @ www.arsdigita.com & later openacs.org. Later I stumbled upon the Tcl'ers wiki & started reading c.l.t. Most other languages I've learned through reading one or more books and trial & error.

...

1. Messing around with TkCon 2. Learn TCL/TK in 24 Hours by the Sastry Doctors (SAMS, ISBN 0-672-31749-4, great little book) 3. Man pages

...

I used the TclTutor by Clif Flynt. Very good. The Welch book and the manual pages to learn TCL. I spent a night building a simple gui, no previous experience with TK for a demo I had to give my management.

...

Brent Welch's and Chris Nelson's books. Paul Duffin was in the same department as me when I started, and was very helpful in pointing me in the right direction ("Yes - it is that simple!"). For Java, a house-mate of mine and I had a challenge to see who could write a Tetris applet first, as neither of us knew Java. He won. It took both of us several weeks to finish them. The resource I used was Java In a Nutshell from O'Reilly.

What things draw you to learn another programming language?

Curiousity, frustration with the low percentage of community working to improve tcl, in the past the slow nature of getting changes into tcl (not so much a problem these days), lack of communication between pockets of community members, and the smaller library of reusable code.

...

Generally, I learn another if either a customer wants me to use it (or has code in it that I need to interface with), or if someone tells me it's useful for a problem that I have. Those two criteria cover an awful lot of languages.

...

Growing robustness, support, and acceptance of Java. A couple of great extensions started in Tcl but seemingly not being developed (Plugin among others)

...

Mere curiosity; I don't know much about ML languages like Haskell, but I'd like to learn, but I don't currently see anything on the horizon that would ever be a serious temptation to replace my love for Tcl.

...

Needed to do scripting, did NOT want to mess with a compiler

...

Business need.

...

Taught on my course, or I see something really neat in that language. (Implementation of quicksort in Haskell caught me with that language).

What resources do you currently use to stay current with Tcl?

comp.lang.tcl, Wiki, Tcl'ers chat; occasionally I drop in at ActiveState, but am mostly disappointed: the Book ActiveState Tcl Cookbook is not growing at a rate it should, and their treatment of Tcl compared to Perl and Python makes me remember Cinderella, the disregarded sister.

...

comp.lang.tcl, ChangeLog

...

comp.lang.tcl* usenet groups, misc mailing lists, and Tcler's Wiki.

...

Beyond reading c.l.t, tcl-core, and the Wiki regularly and keeping my sandbox in sync with the CVS repository at SourceForge? 8^) Seriously, I'm in the thick of Tcl development -- one of the people that the community tries to stay current with. 8^)

...

Wiki; "Tcl-URL!"

...

Comp.lang.tcl tcl.announce. ActiveState web site, Wiki.

...

The need for a portable scripting language. At one time - pre-Tcl of course - I had thought of writing a C program (with Yacc/Lex) that would do DOS batchfiles in a more controlled way. Luckily Tcl came into my life.

...

comp.lang.tcl, wiki, various mailing lists, openacs.org community.

...

  1. google.com. Type anything you need, something someone's already done often comes up.
  2. comp.lang.tcl

...

comp.lang.tcl, Wiki, occasionally I drop in at ActiveState, the cookbook "Tcl-URL!"

...

comp.lang.tcl mainly. I hunt through the wiki when I have time. tclcore mailing list keeps me abreast of current TIPs. tcljava-dev mailing list for news on Jacl (which I love, being much more of a Java programmer than C/C++).


LV tcltutorial points off to the tutorial being built as a document to include with tcl. I'm certain that if there are people who are interested, suggestions, improvements, and corrections would be appreciated.


Rfox The really good Tcl tutorials are those given at the U.S. Tcl conferences (sorry couldn't resist a plug).