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

Why Tcl; the universal scripting language

5 views
Skip to first unread message

casioc...@gmail.com

unread,
Feb 17, 2006, 3:23:22 PM2/17/06
to

Robert Hicks wrote:
> Earl Grieda wrote:
> > "Surgeon" <biyok...@gmail.com> wrote in message
> > news:1136810351.2...@o13g2000cwo.googlegroups.com...
> > > Hi,
> > >
> > > I am a Ruby user and probably I will have to use Tk in order to get
> > > nice GUIs. Now, the problem is that: Learning a new language (Ruby) is
> > > already time consuming enough. Do I have to learn also Tcl in order to
> > > use Tk? Can't I use Tk alone? (Umm, well, not so alone, together with
> > > Ruby, I mean)
> >
> > Why waste time learning Ruby, Python, Perl, etc. when you can do everything
> > easier, faster, and more reliably in Tcl?
>
> My god man! Do you want to start a war! lol
>
> Robert

But he's right. Why be shy about a fact?

I was going to start a thread about this considering that I've been
wanting to commit to a language, but I may just put it here (for some
reason it didn't post under that thread, so here, I'm starting a new
thread). Feel free to correct whatever is not, and do please add to it
if you wish, it's from my notes on tcl as a newbie.

Tcl is can be used on unix, windows, mac, pocketpc, routers or whatever
it's been ported to
Tcl can be used to make desktop gui apps - tk, tclkit, starpack
Tcl can be used for web servers small or big - from tclhttpd to the
industrial aolserver, apache and etc
Tcl can be used for databases - from sqlite (which is best used with
tcl) to the industrial postgresql
Tcl can be used as a shell alternative and for system/network stuff -
tclsh, expect
Tcl can be used ala java applets in a browser - tcl browser plugin and
tclets
Tcl can be used in handhelds - tclkit mobile, etcl

Tcl is a great (perhaps greatest!) language for OOP - xotcl a la lisp
clos, itcl a la c++, snit, stooop, etc

Tcl is great as a 'CS lab' language a la lisp
very simple, minimalist syntax
unity of data and code, everything is a string, everything is a command
polish notation
interpreter available at runtime
can write programs that output programs
liked by the MIT/SICP guys (forget RMS), Hal Abelson is listed as first
author for greenspun's tcl for web nerds
can do functional programming a la lisp or haskell

Tcl can be used either for small, personal stuff (I could put the jim
tcl interpreter and sqlite on a floppy) or it could be used for
industrial stuff a la aol or cisco.

tcl can be an practical alternative for lisp, c or bash. No other
language can do as well in this regard.

The tcl community is very sophisticated and innovative - tcl, tk,
expect, sqlite, xotcl and so on. It's also a polite and pleasant
community. The newsgroups comp.lang.tcl and comp.lang.lisp are
newsgroups in which I'm impressed by the quality of people, it's a
niche of competent intellectuals, not a mob.

Tcl, from what I read, is very stable.

Tcl is mature. It's been around for a long time and likely to last like
lisp did.

Tcl, though mature, is still evolving and innovated.

Tcl is could be liked by both novices and extremely competent hackers,
engineers or academics. A newbie to programming could find it an easy
first language and yet have it in his amibition that a decade later on
he'd find it (tcl) suitable for very advanced and conceptual or
industrial stuff that may not be possible in rigid languages.

Gerald W. Lester

unread,
Feb 17, 2006, 5:09:21 PM2/17/06
to

And you expect us to disagree???

Particularly those of us have been using it for over 14 years?

Besides PL/SQL, I've really not done any serious programming in another
language for at least 10 years. (I don't count doing web pages in HTML
programming).

Robert Hicks

unread,
Feb 17, 2006, 10:08:21 PM2/17/06
to
I said my statement tongue-in-cheek. That said, I have no disagreement
with anything you have said. If I didn't find Perl better at doing web
stuff, I would try to use Tcl for everything.

Robert

Earl Grieda

unread,
Feb 17, 2006, 11:53:19 PM2/17/06
to

"Robert Hicks" <sig...@gmail.com> wrote in message
news:1140232101.3...@o13g2000cwo.googlegroups.com...

> I said my statement tongue-in-cheek. That said, I have no disagreement
> with anything you have said. If I didn't find Perl better at doing web
> stuff, I would try to use Tcl for everything.

I'm just getting started with CGI programming (Linux Apache) but so far Tcl
has been great. I've made CGI programs that build new web-pages based on
submitted information, and other CGI programs that just do programming
stuff. I plan to add SQLlite in the future and have Tcl CGI programs doing
database chores.

Out of curiosity, what web stuff is Perl better at?


verbo...@gmail.com

unread,
Feb 18, 2006, 6:21:28 AM2/18/06
to
You should take a look at AOLserver http://www.aolserver.com . It has
TCL built into the server with a great API for database access etc.
Saves messing about with CGI.

- Steve

Gerald W. Lester

unread,
Feb 18, 2006, 11:08:44 AM2/18/06
to

See also TclHttpd (http://tclhttpd.sf.net). It is built in Tcl and has
several ways of doing Tcl on the Server Side, CGI being one of them. In
particular, take a look at the TML Server Side scripting (you embed Tcl into
HTML pages -- king of hits the same spot as PHP). The down side is the
same as Tcl's, it does not provide a "unified" DB interface but you have to
chose/use the one for your DB.

Eckhard Lehmann

unread,
Feb 18, 2006, 11:25:26 AM2/18/06
to

Robert Hicks wrote:

> If I didn't find Perl better at doing web
> stuff, I would try to use Tcl for everything.

Uhm, I just find perl better for things like

$ cat file.txt | perl -pe 's/<.+>//' > newfile.txt

(BTW, is there a Tcl equivalent for such one-liners?).
Its quite useless for everything else than oneliners IMHO - because of
the strange & unclear syntax.

Did you check out Rivet or Websh (http://tcl.apache.org/)?


Eckhard

Robert Hicks

unread,
Feb 18, 2006, 12:40:07 PM2/18/06
to
I have yet to find anything better at doing the type of web stuff I do
than CGI::Application and Template-Toolkit.

Robert

Robert Hicks

unread,
Feb 18, 2006, 12:41:08 PM2/18/06
to
I was just reading up on that in the Welch book. I had no idea TclHttpd
could do so much and pretty elegantly too. I may use this for some of
my in-house stuff.

Robert

Robert Hicks

unread,
Feb 18, 2006, 12:48:47 PM2/18/06
to
I have checked out both. Rivet is currently having problems with
threaded Tcl and cannot currently run with Apache2. I have also tried
Websh a little but haven't come to a conclusion about it. I would
probably use Rivet over Websh though.

I am also looking at just using the stuff that comes in Tcllib (ncgi,
html, etc.) with Apache (and maybe TclHttpd since I am reading up on
it).

I think Rivet needs get some "high level" attention in the Tcl
community. By that I mean it should be a sub-project like "Tile".
Something the Tcl community can point new users to do web stuff with.

I would strongly disagree with "Perl is useless because of the strange
and unclear syntax". I write clear and concise code in Perl; even when
I go back six months.

I would rather be doing Tcl though. : )

Robert

Cameron Laird

unread,
Feb 19, 2006, 10:08:02 AM2/19/06
to
In article <1140261688.6...@z14g2000cwz.googlegroups.com>,
.
.
.
As someone who was turning down CGI business in 1997 'cause
I'd (mis)figured out it had no future, I'll speak up for it.
Folks, CGI can be handy, and there are still times when it's
the best tool for the job.

AOLserver, tclhttpd, Rivet, and so on *are* quite wonderful;
I agree with that, too.

Eckhard Lehmann

unread,
Feb 19, 2006, 11:49:31 AM2/19/06
to

Robert Hicks wrote:
> I have checked out both. Rivet is currently having problems with
> threaded Tcl and cannot currently run with Apache2.

I started a port for Apache 2, currently accessible via the subversion
repository. Will continue as soon as I have enough time again.
Hopefully others work on it as well, so it will be useful sometime...

> I would strongly disagree with "Perl is useless because of the strange
> and unclear syntax". I write clear and concise code in Perl; even when
> I go back six months.

Good on you, keep on :-)!
I have only seen poor Perl code so far. Too many ways of doing things,
too many strange characters... Everybody does it different and it's
difficult to maintain someone else's code. The way object orientation
is handled... *brrrr*.
I have my opinion on perl - a rather bad one. However, I don't force
this opinion to other people. But I will never start anything with perl
if I don't have to ;-)!


Eckhard

Robert Hicks

unread,
Feb 19, 2006, 2:37:58 PM2/19/06
to
I would stress...although I am semi-good at Perl (being a beginner), I
would much rather being using Tcl.

Robert

Robert Hicks

unread,
Feb 19, 2006, 2:39:24 PM2/19/06
to
Oh, and OO in Perl does suck. Even I can't make excuses for that. :)

I use Snit in Tcl and I really like it. I haven't looked at XOTcl yet
but that is on my list as well.

Robert

Donal K. Fellows

unread,
Feb 19, 2006, 4:02:16 PM2/19/06
to
Eckhard Lehmann wrote:
> (BTW, is there a Tcl equivalent for such one-liners?).

No. Or at least not without an extra script to provide the magical
processing of command-line args that tclsh omits (on the grounds that it
is confusing and Yet Another D@mn Thing To Go Wrong). This is a known
strength of Perl; Larry Wall loves one-liners.

> Its quite useless for everything else than oneliners IMHO - because of
> the strange & unclear syntax.

I use Perl for horrible setuid stuff. OK, the code that does it is about
as elegant as a kick in the face, but it works and doesn't require any
code not already in Perl (making it easier to deploy on fancy hardware).
But for everything else, if it's long enough to be worth writing in a
file in the first place, it's (almost) always better written in Tcl. :-)

Donal.

Bryan Oakley

unread,
Feb 19, 2006, 6:47:39 PM2/19/06
to
Donal K. Fellows wrote:
> ...

> But for everything else, if it's long enough to be worth writing in a
> file in the first place, it's (almost) always better written in Tcl. :-)

Nominated for QOTW.

--
Bryan Oakley
http://www.tclscripting.com

Sektor van Skijlen

unread,
Feb 21, 2006, 4:16:25 AM2/21/06
to
Dnia Sun, 19 Feb 2006 21:02:16 GMT, Donal K. Fellows skrobie:

> Eckhard Lehmann wrote:
> > (BTW, is there a Tcl equivalent for such one-liners?).

> No. Or at least not without an extra script to provide the magical
> processing of command-line args that tclsh omits (on the grounds that it
> is confusing and Yet Another D@mn Thing To Go Wrong). This is a known
> strength of Perl; Larry Wall loves one-liners.

In the package of TclX (I have just "emerged" on my Gentoo), there is a
command "tcl" included. Works similarly to "perl -e":

tcl "puts [file tail [pwd]]"


--
// _ ___ Michal "Sektor" Malecki <sektor(whirl)kis.p.lodz.pl>
\\ L_ |/ `| /^\ ,() <ethourhs(O)wp.pl>
// \_ |\ \/ \_/ /\ C++ bez cholesterolu: http://www.intercon.pl/~sektor/cbx
"I am allergic to Java because programming in Java reminds me casting spells"

0 new messages