views:

516

answers:

10

Hi,

One of my modules at university next year is going to involve programming in Tcl tk, I was wondering where to find the best resources and information about the language, so that I am well prepared. I'm currently looking on this site which is pretty helpful, but the book that they recommend is quite old, and I was wondering if someone could recommend any other books to purchase or if the language hasn't changed significantly since the release of the book in 1999?

Also, what projects or examples should I start working on to make me familiar with the language?

Any other information would be extremely helpful and appreciated!

I posted this question because I couldn't find any others similar too it, apologies if I haven't looked hard enough.

Thanks in advance,

+6  A: 

Are you familiar with the Active Tcl distribution? If not, then this is the best place to start looking for resources and documentation.

kgiannakakis
No, I'm not but I'll check it out, I don't have any experience with it so anything to point me in the right direction would be a great help
ThePower
+1 If you're working on windows the Activestate distributions are perhaps the best windows-based distros of scripting languages out there.
ConcernedOfTunbridgeWells
+15  A: 
RHSeeger
Thanks a lot for the recommendations, appreciated.
ThePower
No problem at all. To this day, every time I program in another language, I'm constantly aware of what Tcl can do (and I expect to be able to do) that the language I'm using can't. I guess it's kind of the way Lispers feel about Lisp... I love Tcl, there's power there that very few (non-Lisp-esque) languages can match.
RHSeeger
I second the nod to "Practical Programming in Tcl and Tk". It was one of the first books I bought for my current assignment.
Michael Mathews
Thanks for the Tcl love. I used to write lots of scripts in Perl, but our industry has adpoted the Tcl interpreter as a way of providing custom scripting and commands. Now I write most of my utility and config management scripts in Tcl because I'm so comfortable with it.
Michael Mathews
I liked "Practical Programming in Tcl and Tk", but I could have used a little more focus on Tcl.
Jason Jackson
+1 here for /Practical Programming in Tcl and Tk/
Nir Levy
There's the second edition of *Tcl and the Tk Toolkit* out since this question was originally answered. It covers up to Tcl 8.5. (Disclosure: I wrote part of it.)
Donal Fellows
+1  A: 

but the book that they recommend is quite old,

The fact about tcl is, it is quite old, the book by Ousterhout is still the best book on tcl (and IMHO, almost a classic). There was never even a second edition although one is apparently in the making. tcl was a great idea at the time and it doesn't really hurt to learn it, but it hasn't kept up and frankly had a lot of design issues from the start. Don't get me wrong, I was a huge fan of tcl back in the day, but it's not the best thing to be learning now. If you decide to carry-on, pick up a used copy of the original book and use the online resources.

The original purpose of tcl was to be easy and free enough to eliminate the need for the myriad of home-grown command languages that folks were writing to add interactivity to their applications. Later, the Tk toolkit was added and it was the easiest, free way to add a GUI to an application.

Today, there are a lot more options available (for example for GUI's the Qt toolkit is now under the LGPL therefore almost as free at Tk. For adding a command line interface to an existing C / C++ application, the closest modern tool is Lua, but even more powerful languages like ruby and python are not much harder to integrate with C/ C++ applications (especially with tools like boost python and SWIG).

David Nehme
Second edition of the Ousterhout book is due in September.
Colin Macleod
Frankly, I would say Oursterhout's book is far from the best. It's just way too outdated. It covers the basics fine but the language has changed quite a lot over the years.
Bryan Oakley
First, let me say that I am a quiet Tcl/Tk aficionado, so don't take my opinion as unbiased, but I would say that overall Ruby and Python are no more "powerful" than Tcl, just a whole lot more syntactically complicated, which is not a good thing. Granted they do have object orientation, which is much abused and is just now making it into the Tcl core; but they don't have a built in event-loop, which is amazing and a feature of Tcl.
ws
A: 

There is masses of information on the Tcl Wiki, though it can be hard to find things. A look at the Recent Changes page will show that there's plenty of activity going on.

Colin Macleod
+3  A: 

You can also try TclTutor interactive application where you can not only learn the materail but also try it at once.

msorc
A: 

Able to program in Tcl may not land you a job, but it certainly can help you to get the work done fast. I learned Tcl back in 1996 and Tcl is still one of my favorite programming languages in solving most of my daily sys admin work. In most cases, I am able to accomplish the same task when my programming colleagues are still on the drawing board designing the object classes.

I like to say "Tcl may not help you _get_ a job, but it will certainly help you _do_ the job" :-)
Bryan Oakley
A: 

I've also bookmarked www.tcl.tk/doc for a quick reference if I can't quite remember the order of the args or something.

Michael Mathews
+3  A: 

I also recommend Tcl and the Tk Toolkit. It is great for understanding the core of Tcl, though I can't comment on how useful it is as a reference (I use the online documentation for that). The second edition of Tcl and the Tk Toolkit is currently available as a "Rough Cut" from Safari Books Online (meaning that you can download a draft PDF now and a final PDF when the book is released). They seem to have added a bunch of information about Tk, especially the themed widgets that were introduced in 8.5. They also added some information to the section about Tcl, including dictionaries.

Daniel Yankowsky
+1  A: 

An second edition of Ousterhout's book, updated and augmented by Ken Jones, is available. It has a release year of 2010, so the second edition is pretty current. Also, the wiki page http://wiki.tcl.tk/57 has a list of a number of books that deal with Tcl in some capacity.

lvirden
+1  A: 

Use this invaluable reference guide or this more up-to-date quick ref (thanks to Colin Macleod).

Pat
That's for version 8.0 which is very old. A more up-to-date quick ref can be found at http://home.comcast.net/~brian199/tcl_tk_ref_guide.html
Colin Macleod