Re: Why Tcl is a Bad Thing

Glenn Vanderburg (glv@utdallas.edu)
7 Oct 1994 14:14:49 GMT

Brent Welch writes:
>
> >>>Bill Janssen said:
> >
> > The first is that Tcl is just not good enough, for anything. That is,
> > for any given task, there is a better extension/scripting language to
> > use. Tcl is slow and clumsy with offensive syntax. It lacks
> > byte-compilation, internal binary representations, dynamic loading of
> > object code, ability to extend Tcl in Tcl, a standard object system --
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

When I first read Bill's article, I somehow missed this particular
criticism. I'm glad Brent called it to my attention, because it is
hilarious.

> Lacks ability to extend Tcl in Tcl. WRONG - as well as obvious things like
> procedures, there are constructs that let you write new control structures,

I'd like to present an example of this. Lindsay Marshall has written
an exception-handling facility for Tcl (called tihsho), modelled on
C++ exceptions, but adapted to Tcl syntax. He provides two
implementations, which function identically. One implementation (the
first to be written, as a morning hack) is in Tcl. The other is a C
extension to the Tcl interpreter.

$ wc -l tihsho.c tihsho.tcl
220 tihsho.c
52 tihsho.tcl

Not only is the Tcl version shorter, but to me it is much clearer and
easier to understand.

In a (probably futile) attempt to ward off irrelevant rebuttals (as
opposed to relevant ones, which are welcome), I want to make something
clear.

I realize that a similar task could almost certainly have been
accomplished in Scheme (for example) with even less code. I am not
attempting to argue that Tcl is special in permitting this; I'm not
that ignorant.

But to say that one cannot extend Tcl in Tcl is simply wrong. And
it's interesting to me to note that Tcl permits such feats without
having to resort to things like special forms and macros.

---glv