Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Good book for learning Tcl?

657 views
Skip to first unread message

Joey Cuccinardo

unread,
Oct 13, 2013, 6:49:26 AM10/13/13
to
Hi Tclers,

Can somebody recommend me please a good book to learn Tcl? I have written a
few programs and didn't have much difficulty but somehow I feel I'm not
getting the Tcl culture. For anything complicated I seem to go back to
another scripting language I know better. Is there a good book that explains
all we need to understand Tcl in the right way to use it? I saw a few older
books in a used bookstore but I don't know if Tcl changed too much and these
books are no good now.

Ciao,

Joey

Zbigniew Diaczyszyn

unread,
Oct 13, 2013, 8:21:23 AM10/13/13
to
> Hi Tclers,
>
> Can somebody recommend me please a good book to learn Tcl?

Effective Tcl/Tk Programming. 1998

Practical Programming in Tcl and Tk. 2003



Heinz-Jürgen Oertel

unread,
Oct 13, 2013, 8:37:24 AM10/13/13
to
Tcl and the Tk Toolkit (2nd Edition)
by John K. Ousterhout, 2009

--
mit freundlichen Grüßen
Heinz-Jürgen Oertel

Joey Cuccinardo

unread,
Oct 13, 2013, 8:53:55 AM10/13/13
to
I worry I will miss some important changes in the approach to Tcl programming
from buying older books but the new ones I find cost nearly 100 USD. Is
there any problem about fundamental changes in Tcl since these books were
printed? Or only details on the newest Tcl functions etc.?

Other languages like Java and C++ change so much in these years the old
books are only for keeping the door open :-(

Many thanks,

Joey

Joey Cuccinardo

unread,
Oct 13, 2013, 8:55:10 AM10/13/13
to
On 2013-10-13, Heinz-J?rgen Oertel <hj.o...@t-online.de> wrote:
> Zbigniew Diaczyszyn wrote:
>
>>> Hi Tclers,
>>>
>>> Can somebody recommend me please a good book to learn Tcl?
>>
>> Effective Tcl/Tk Programming. 1998
>>
>> Practical Programming in Tcl and Tk. 2003
>
> Tcl and the Tk Toolkit (2nd Edition)
> by John K. Ousterhout, 2009
>

It's great news. I didn't know the creator of Tcl is still writing books and
involved in it! Thanks for the information. Now to find a cheap copy some way...

Ciao,

Joey

Zbigniew Diaczyszyn

unread,
Oct 13, 2013, 9:58:41 AM10/13/13
to
Am 13.10.2013 14:53, schrieb Joey Cuccinardo:
> I worry I will miss some important changes in the approach to Tcl
programming
> from buying older books

Well, I am refering to your first post:

> but somehow I feel I'm not
> getting the Tcl culture.

"Effective Tcl/Tk Programming" will give you the feeling for the Tcl/Tk
culture. In this aspect it is not important that it is based on Tcl 8.0.
And it is not expensive, cf. the Amazon offer: 39 used from $1.78

Tcl/Tk has essentially not changed that much. The ttk enhancement is
still Tk and the new OO feature is not an essential Tcl feature: you can
live without it and yet program "complicated" things.

And I am sure you will agree: reducing complicated things to simple
things is the best way to step forward in every programming language :-)

Les Cargill

unread,
Oct 13, 2013, 1:41:24 PM10/13/13
to
Joey Cuccinardo wrote:
> On 2013-10-13, Zbigniew Diaczyszyn <z-...@t-online.de> wrote:
>>> Hi Tclers,
>>>
>>> Can somebody recommend me please a good book to learn Tcl?
>>
>> Effective Tcl/Tk Programming. 1998
>>
>> Practical Programming in Tcl and Tk. 2003
>
> I worry I will miss some important changes in the approach to Tcl programming
> from buying older books but the new ones I find cost nearly 100 USD. Is
> there any problem about fundamental changes in Tcl since these books were
> printed? Or only details on the newest Tcl functions etc.?
>

There are many, many approaches. "Practical Programming" shows some
pretty darn good ones. It is best for teaching event-driven-ness of
I/O channels and for the basics of Tk.

> Other languages like Java and C++ change so much in these years the old
> books are only for keeping the door open :-(
>

Tcl seesm to have avoided that, in my opinion.

> Many thanks,
>
> Joey
>

--
Les Cargill

JonoK

unread,
Oct 14, 2013, 1:36:49 AM10/14/13
to
On Sunday, 13 October 2013 21:49:26 UTC+11, Joey Cuccinardo wrote:
> Hi Tclers,
>
>
>
> Can somebody recommend me please a good book to learn Tcl? I have written a
>
> few programs and didn't have much difficulty but somehow I feel I'm not
>
> getting the Tcl culture. For anything complicated I seem to go back to
>
> another scripting language I know better.
>

If you're just browsing, sure get a book. My advice: next time you have an actual task, force yourself to do it in TCL. Better than any book. Everything you need to know is in the man pages or the wiki or google. If you get really stuck, ask here.

J

tcl....@gmail.com

unread,
Oct 14, 2013, 2:06:37 AM10/14/13
to
"Practical Programming in Tcl & Tk" --- a book I grew up with, practically became a bible to me, I was reading it on daily basis.

Also, it is a good practice to read more than one book on the same topic. Each author explains the topic from his/her unique angle, which is very helpful.

Ralf Fassel

unread,
Oct 14, 2013, 6:36:51 AM10/14/13
to
* Joey Cuccinardo <jcu...@tuccicucci.it>
| Can somebody recommend me please a good book to learn Tcl?

Others have already suggested "Practical Programming" Hobbs/Welch 2003,
I'd second that.

And online, there is
http://wiki.tcl.tk
http://wiki.tcl.tk/20789

which also has tons of examples and more info and pointers to tutorials.

HTH
R'

Joey Cuccinardo

unread,
Oct 14, 2013, 7:43:40 AM10/14/13
to
On 2013-10-13, Zbigniew Diaczyszyn <z-...@t-online.de> wrote:
Hi, I find this one Practical Programming in Tcl and Tk in a 1999
editione. Is it still ok or perhaps I should continue to look for the 2003?

Thanks,

Joey

Joey Cuccinardo

unread,
Oct 14, 2013, 7:45:08 AM10/14/13
to
On 2013-10-13, Zbigniew Diaczyszyn <z-...@t-online.de> wrote:
> Am 13.10.2013 14:53, schrieb Joey Cuccinardo:
>> I worry I will miss some important changes in the approach to Tcl
> programming
>> from buying older books
>
> Well, I am refering to your first post:
>
>> but somehow I feel I'm not
>> getting the Tcl culture.
>
> "Effective Tcl/Tk Programming" will give you the feeling for the Tcl/Tk
> culture. In this aspect it is not important that it is based on Tcl 8.0.
> And it is not expensive, cf. the Amazon offer: 39 used from $1.78
>
> Tcl/Tk has essentially not changed that much. The ttk enhancement is
> still Tk and the new OO feature is not an essential Tcl feature: you can
> live without it and yet program "complicated" things.

Thanks for confirming it.

>
> And I am sure you will agree: reducing complicated things to simple
> things is the best way to step forward in every programming language :-)

Sure but sometimes the language changes so much the old way of doing
something isn't good now.

Joey

Joey Cuccinardo

unread,
Oct 14, 2013, 7:46:34 AM10/14/13
to
On 2013-10-13, Les Cargill <lcarg...@comcast.com> wrote:
> Joey Cuccinardo wrote:
>> On 2013-10-13, Zbigniew Diaczyszyn <z-...@t-online.de> wrote:
>>>> Hi Tclers,
>>>>
>>>> Can somebody recommend me please a good book to learn Tcl?
>>>
>>> Effective Tcl/Tk Programming. 1998
>>>
>>> Practical Programming in Tcl and Tk. 2003
>>
>> I worry I will miss some important changes in the approach to Tcl programming
>> from buying older books but the new ones I find cost nearly 100 USD. Is
>> there any problem about fundamental changes in Tcl since these books were
>> printed? Or only details on the newest Tcl functions etc.?
>>
>
> There are many, many approaches. "Practical Programming" shows some
> pretty darn good ones. It is best for teaching event-driven-ness of
> I/O channels and for the basics of Tk.

Good information. I didn't try Tk much but it was confusing for me.

>
>> Other languages like Java and C++ change so much in these years the old
>> books are only for keeping the door open :-(
>>
>
> Tcl seesm to have avoided that, in my opinion.

Excellent. This was my main question. Thanks.

Joey

Joey Cuccinardo

unread,
Oct 14, 2013, 7:50:19 AM10/14/13
to
You are right my friend. This is what I did. But then when the next thing
came up I went back to my usual scripting language because pattern matching
is so much easier. It takes me longer to do this kind of work in Tcl but the
advantage of Tcl is it's possible to structure a program much nicer. I feel
for a large script or large system of many scripts Tcl will win. Until now
most of my scripts are not so large.

Really I can get the results with the info online but I still have the bad
feeling maybe my solution isn't the Tcl way of writing. For this I think
maybe some book will help. And I already receive some nice suggestions for
this. Thanks everybody.

Joey

Joey Cuccinardo

unread,
Oct 14, 2013, 7:52:41 AM10/14/13
to
On 2013-10-14, tcl....@gmail.com <tcl....@gmail.com> wrote:
> On Sunday, October 13, 2013 3:49:26 AM UTC-7, Joey Cuccinardo wrote:
>> Hi Tclers,
>>
>>
>>
>> Can somebody recommend me please a good book to learn Tcl? I have written a
>>
>> few programs and didn't have much difficulty but somehow I feel I'm not
>>
>> getting the Tcl culture. For anything complicated I seem to go back to
>>
>> another scripting language I know better. Is there a good book that explains
>>
>> all we need to understand Tcl in the right way to use it? I saw a few older
>>
>> books in a used bookstore but I don't know if Tcl changed too much and these
>>
>> books are no good now.
>>
>>
>>
>> Ciao,
>>
>>
>>
>> Joey
>
> "Practical Programming in Tcl & Tk" --- a book I grew up with, practically became a bible to me, I was reading it on daily basis.
>

I find the 1999 version of this book in a store here. It's good enough or
the 2003 version is required? I didn't find it yet. Thanks.

> Also, it is a good practice to read more than one book on the same topic. Each author explains the topic from his/her unique angle, which is very helpful.

Yes my friend. It's very good advise. Only to find a few books that
everybody agrees on :-)

Joey

Joey Cuccinardo

unread,
Oct 14, 2013, 7:53:22 AM10/14/13
to
> And online, there is
> http://wiki.tcl.tk
> http://wiki.tcl.tk/20789

thanks

Joey

Rich

unread,
Oct 14, 2013, 9:49:47 AM10/14/13
to
Joey Cuccinardo <jcu...@tuccicucci.it> wrote:
: On 2013-10-14, JonoK <jonk...@fastmail.fm> wrote:
: > On Sunday, 13 October 2013 21:49:26 UTC+11, Joey Cuccinardo wrote:
: >> Hi Tclers,
: >>
: >> Can somebody recommend me please a good book to learn Tcl? I have
: >> written a few programs and didn't have much difficulty but somehow
: >> I feel I'm not getting the Tcl culture. For anything complicated I
: >> seem to go back to another scripting language I know better.
: >>
: >
: > If you're just browsing, sure get a book. My advice: next time you
: > have an actual task, force yourself to do it in TCL. Better than
: > any book. Everything you need to know is in the man pages or the
: > wiki or google. If you get really stuck, ask here.
: >

: You are right my friend. This is what I did. But then when the next
: thing came up I went back to my usual scripting language because
: pattern matching is so much easier. It takes me longer to do this
: kind of work in Tcl ...

Care to elaborate on how it is "so much easier"? Also, are you not
sure it is "easier" and/or faster just because you already know the
other language well, and do not know Tcl as well? Tcl has some very
powerful string pattern matching facilities, so it should be able to
achieve your end results. Just maybe not using the same steps as you
would use with the other language.

Joey Cuccinardo

unread,
Oct 14, 2013, 1:59:10 PM10/14/13
to
On 2013-10-14, Rich <mail...@dp100.com> wrote:
> Joey Cuccinardo <jcu...@tuccicucci.it> wrote:
>: On 2013-10-14, JonoK <jonk...@fastmail.fm> wrote:
>: > On Sunday, 13 October 2013 21:49:26 UTC+11, Joey Cuccinardo wrote:
>: >> Hi Tclers,
>: >>
>: >> Can somebody recommend me please a good book to learn Tcl? I have
>: >> written a few programs and didn't have much difficulty but somehow
>: >> I feel I'm not getting the Tcl culture. For anything complicated I
>: >> seem to go back to another scripting language I know better.
>: >>
>: >
>: > If you're just browsing, sure get a book. My advice: next time you
>: > have an actual task, force yourself to do it in TCL. Better than
>: > any book. Everything you need to know is in the man pages or the
>: > wiki or google. If you get really stuck, ask here.
>: >
>
>: You are right my friend. This is what I did. But then when the next
>: thing came up I went back to my usual scripting language because
>: pattern matching is so much easier. It takes me longer to do this
>: kind of work in Tcl ...
>
> Care to elaborate on how it is "so much easier"?

Everybody now uses regexp right? But some older languages had their own
system which is more flexible and easier to use. The language I use is
designed for pattern matching not for scripting but most of my scripting
used pattern matching heavily it's a good fit. But big programs become hard
to manage. So I look for another candidate and Tcl has many positive aspects.

> Also, are you not sure it is "easier" and/or faster just because you
> already know the other language well, and do not know Tcl as well? Tcl
> has some very powerful string pattern matching facilities, so it should be
> able to achieve your end results. Just maybe not using the same steps as
> you would use with the other language.

Yes it's possible because I don't know Tcl well but in pattern matching
regexp is more complicated and harder to use than what I'm using. Also I
have very good associative arrays, I think it's included in Tcl but I forgot
the name maybe hashes. It's the reason I'm looking for a book. Not for the
pattern matching which isn't as good in any language not just Tcl but for
the approach to using Tcl the way it should be used.

Ralf Fassel

unread,
Oct 15, 2013, 5:16:10 AM10/15/13
to
* Joey Cuccinardo <jcu...@tuccicucci.it>
| Yes it's possible because I don't know Tcl well but in pattern matching
| regexp is more complicated and harder to use than what I'm using.

Post an example of the 'old' code, and you will probably get a response
how to do it in TCL. You don't have to use regexp, there is also
'string match' which uses a kind of shell globbing syntax.

| Also I have very good associative arrays, I think it's included in Tcl
| but I forgot the name maybe hashes.

Basically in TCL its also very easy:
set key foo
set name($key) bar
puts "name($key) is {$name($key)}"

Check the array manpage for more:
http://www.tcl.tk/man/tcl8.5/TclCmd/array.htm

HTH
R'

TD

unread,
Oct 15, 2013, 3:14:04 PM10/15/13
to
Hi Joey,

I also prefer to read a book about a new programming language while
start coding. Learning a new language based on man pages only increases
IMHO the risk to code with different syntax but with the design pattern
of the known language. Each time I see tcl scripts from colleagues with
c or perl background I miss the usage of the tcl event mechanism power
(instead of that they use while/for loops and poll data sources).

For me it was a good choice to start with writing a GUI/TK app to become
familiar with the tcl/tk event handling and preferred tcl script design.
At this time "Tcl and the Tk Toolkit" and "Effective Tcl/Tk Programming"
was always on my desk.

Torsten

Rani Ahmad

unread,
Oct 15, 2013, 3:38:32 PM10/15/13
to
Hi. Try this Android App.
https://play.google.com/store/apps/details?id=net.superlinux.tcltktutorialspaid
36 video tutorials explained in both spoken Arabic and spoken English.

Joey Cuccinardo

unread,
Oct 16, 2013, 6:58:46 AM10/16/13
to
On 2013-10-15, Ralf Fassel <ral...@gmx.de> wrote:
> * Joey Cuccinardo <jcu...@tuccicucci.it>
>| Yes it's possible because I don't know Tcl well but in pattern matching
>| regexp is more complicated and harder to use than what I'm using.
>
> Post an example of the 'old' code, and you will probably get a response
> how to do it in TCL. You don't have to use regexp, there is also
> 'string match' which uses a kind of shell globbing syntax.

I don't think posting the old code is going to help but maybe if I ask for
specific assistance later I will try anyway.

>
>| Also I have very good associative arrays, I think it's included in Tcl
>| but I forgot the name maybe hashes.
>
> Basically in TCL its also very easy:
> set key foo
> set name($key) bar
> puts "name($key) is {$name($key)}"
>
> Check the array manpage for more:
> http://www.tcl.tk/man/tcl8.5/TclCmd/array.htm

Thanks.

Joey Cuccinardo

unread,
Oct 16, 2013, 7:01:44 AM10/16/13
to
On 2013-10-15, TD <fore...@arcor.de> wrote:
> Hi Joey,

Hi Torben, great post. Yes exactly my feelings.

>
> I also prefer to read a book about a new programming language while
> start coding. Learning a new language based on man pages only increases
> IMHO the risk to code with different syntax but with the design pattern
> of the known language. Each time I see tcl scripts from colleagues with
> c or perl background I miss the usage of the tcl event mechanism power
> (instead of that they use while/for loops and poll data sources).
>
> For me it was a good choice to start with writing a GUI/TK app to become
> familiar with the tcl/tk event handling and preferred tcl script design.
> At this time "Tcl and the Tk Toolkit" and "Effective Tcl/Tk Programming"
> was always on my desk.

I found the 1999 copy of Practical Programming in Tcl and Tk but I don't
know if the person who recommends the 2003 editione had a specific reason
the 1999 version might not be good and he didn't answer. I will try to get
the 2009 editione of Tcl and the Tk Toolkit later also.

Joey

Donald Arseneau

unread,
Oct 18, 2013, 2:09:38 AM10/18/13
to
Joey Cuccinardo <jcu...@tuccicucci.it> writes:

> Hi, I find this one Practical Programming in Tcl and Tk in a 1999
> editione. Is it still ok or perhaps I should continue to look for the 2003?

I vaguely recall that some of the most heavily revised chapters
are available online.

--
Donald Arseneau as...@triumf.ca

Joey Cuccinardo

unread,
Oct 18, 2013, 2:50:25 AM10/18/13
to
On 2013-10-18, Donald Arseneau <as...@triumf.ca> wrote:
> Joey Cuccinardo <jcu...@tuccicucci.it> writes:
>
>> Hi, I find this one Practical Programming in Tcl and Tk in a 1999
>> editione. Is it still ok or perhaps I should continue to look for the 2003?
>
> I vaguely recall that some of the most heavily revised chapters
> are available online.
>

That defeats the purpose of having a book. Almost everything can be found
online but I still prefer killing trees and drinking coffee from styrofoam
cups (ok when I am in the U.S.) when I have a choice.

Joey

David Good

unread,
Dec 5, 2013, 3:56:58 PM12/5/13
to
On Friday, October 18, 2013 1:50:25 AM UTC-5, Joey Cuccinardo wrote:
> On 2013-10-18, Donald Arseneau <> wrote:
>
> > Joey Cuccinardo <> writes:
>
> >
>
> >> Hi, I find this one Practical Programming in Tcl and Tk in a 1999
>
> >> editione. Is it still ok or perhaps I should continue to look for the 2003?
>
> >
>
> > I vaguely recall that some of the most heavily revised chapters
>
> > are available online.
>
> >
>
>
>
> That defeats the purpose of having a book. Almost everything can be found
>
> online but I still prefer killing trees and drinking coffee from styrofoam
>
> cups (ok when I am in the U.S.) when I have a choice.
>
>
>
> Joey

I don't know why no one mention Clif Flynt's "Tcl/Tk, Third Edition: A Developer's Guide", so here it is:

http://www.amazon.com/Tcl-Third-Edition-Engineering-Programming/dp/0123847176

The third edition has TclOO coverage and other modern uses of Tcl/Tk.

--David

Asif

unread,
Dec 9, 2013, 12:55:31 PM12/9/13
to
A few tips that might help you get familiar with tcl faster:

1) Use tclsh shell (instead of bash) in emacs.
M-x ielm
(setq shell-file-name "/usr/bin/tclsh")
M-x shell
WARNING: You cannot use Ctrl-C to kill a program. It will kill tclsh. But you can still start tclsh and continue. The contents of the emacs buffer are not lost.

2) You can use inferior-tcl:
http://www.rgrjr.com/emacs/advanced.html

3) tcl man-pages in emacs:
M-x woman

4) If emacs is not your editor of choice then you can use tkcon.

5) This might sound strange, but I would recommend the book on Expect:
http://expect.sourceforge.net/

bsall...@yahoo.com

unread,
Feb 6, 2014, 7:40:54 PM2/6/14
to
On Sunday, October 13, 2013 6:49:26 AM UTC-4, Joey Cuccinardo wrote:
> Hi Tclers,
>
>
>
> Can somebody recommend me please a good book to learn Tcl?

I started with "Graphical Applications with Tcl & Tk", Second edition. Eric Foster-Johnson. It included a CD with all the examples code and even the tcl & tk code. I liked it since it was geared to the GUI capabilities. The code of the examples was short and simple which I like since this shows the capabilities that the new language is providing for coding which is all I want to know at the beginning of learning a new language.
0 new messages