
TclWise: Guide to the Tcl programming language (2004) - netten
http://www.invece.org/tclwise/
======
ofrzeta
The author Salvatore Sanfilippo (antirez) is also the author of the Redis key
value store. Funny, I didn't know he had written a book on Tcl.

As an embedded scripting language for Redis he didn't pick Tcl but Lua,
though.

------
systems
if someone is really interested in learn Tcl (not Tk) i strongly recommend
"Tcl 8.5 Network Programming" by Wojciech Kocjan and Piotr Beltowski

while the book is not very recent, Tcl didnt change much in the past few years

Tcl is really a super nice language, i think if they manage to get a cpan like
platform, and maybe decent ide support .. it should be on every programmer
list of languages

~~~
bambambazooka
What makes Tcl special and worth to learn?

~~~
isr
(not OP, but hope you don't mind my $0:02)

tcl is what you get when you take shell and lisp, and smash them into each
other.

In many ways, its a lisp whose central data structure is the string, rather
than than the linked list (so, a sisp?). And instead of macros, you have
fexpressions (functions which can decide at runtime whether or not to evaluate
its arguments).

When you understand it like that, you can write some elegant code in it. And
as it does have proper, efficient data structures under the hood, performance
is on par with most other mainstream, traditional "scripting" languages.
Although semantically, everything has a string representation - if you're
creating a list, and use it as a list, it only exists in memory as a list (as
so you dont pay performance costs of auto-casting to and from its string
representation).

2 things really tick (goes with tickle, I guess) me off though:

1\. because everything has a string rep, its hard to write code which can
handle polymorphic types. For example, say a parsing routine which can take
either a string, or a list of strings.

You end up having to 'tag' your data somehow (basically, roll your own static
typing), which just feels wrong in such a dynamic language.

(could just be my deficiencies in using it, though)

(on the plus side, rolling your own tagging system using tcl ensembles shows
just how malleable the language is. You can almost turn it into anything)

2\. the parser could do with some changes. Too much tcl code just looks ugly
because you (well, I) can't indent it the way I would like. So you (err, I)
end up with /'s everywhere.

Bottomline: tcl is __so __close to being the perfect drop-in replacement for
bash (if only the last extra yard was taken) that its painful to go back to
using bash for, well, anything.

~~~
rkeene2
If you like using Tcl as a replacement for bash you might enjoy "pipethread"

[http://www.rkeene.org/tmp/pipethread-presentation-
withnotes....](http://www.rkeene.org/tmp/pipethread-presentation-
withnotes.pdf)

[https://chiselapp.com/user/rkeene/repository/pipethread/](https://chiselapp.com/user/rkeene/repository/pipethread/)

~~~
isr
(sorry for the late reply, just saw this now)

Thanks for the info - reading your pdf now :-)

------
mchahn
Hmmm. Can any language manual be a HN post? Maybe I could get some points by
posting 10 or 20.

------
jasondebo
Should this say (2004) in the title?

~~~
dang
Added now. Thanks!

