From: lvirden@cas.org (Larry W. Virden)
Subject: comp.lang.tcl Frequently Asked Questions (1/3)
	 (Last updated: January 12, 1992)
Followup-To: comp.lang.tcl
Summary: A regular posting of the comp.lang.tcl Frequently Asked Questions 
	(FAQ) and their answers.  This is the first of three parts.
Originator: lwv26@lwv26aws
Keywords: tcl, extended tcl, tk, expect
Supersedes: <tcl.p1_724079551@cas.org>
Reply-To: lvirden@cas.org (Larry W. Virden)
Organization: Chemical Abstracts Service
Date: Tue, 12 Jan 1993 14:02:33 GMT
Expires: Thu, 25 Feb 1993 14:02:27 GMT

Archive-name: tcl-faq/part1
Version: 2.7
Last-modified: January 12, 1992


Index of questions:

0. Origin of the comp.lang.tcl FAQ information.
1. What is Tcl?	 Tk?  Extended Tcl?  How does Tcl compare against language 
	XXX?
2. Do these packages run on my machine?
	a. Unix
	b. MacOS
	c. MS-DOS
	d. VMS
3. Other than C, What languages can talk to tcl/tk?
	a. Shell
	b. C++
        c. Modula-3
4. Is there a bibliography of material relating to these programs?
5. Where do I report problems, bugs, or enhancements - or -
	What is comp.lang.tcl?
6. Where can I find the FAQ and who do I contact for more information 
	about it?
	
End of FAQ Index

------------------------------
Subject: -0- Origin of the comp.lang.tcl FAQ information.

The information in this set of FAQs comes from 3 sources.  The primary
source of information is the group itself - I spent (much too much) time
each month culling through what I feel are some of the best answers,
gathering up new information on ports, etc. and adding it here.  I also
gather together new application information and add it as best I can.
The next most predominant source of information comes from the authors
of the various software packages.  Finally, a small amount comes from
my personal experiences.

I am always on the search for folk to assist in the maintenance of these
FAQs.  In fact, if you feel that you would like to coordinate this 
effort, PLEASE let me know!

Subject: -1- What is Tcl?  Tk?  Extended Tcl?  How does Tcl compare
		against language XXX?

	Tcl (version 6.5) stands for ``tool command language'' and is
pronounced ``tickle.'' It is actually two things: a language and a
library.  First, Tcl is a simple textual language, intended primarily
for issuing commands to interactive programs such as text editors,
debuggers, illustrators, and shells.  It has a simple syntax and is
also programmable, so Tcl users can write command procedures to provide
more powerful commands than those in the built-in set.

	Second, Tcl is a library package that can be embedded in
application programs.  The Tcl library consists of a parser for the Tcl
language, routines to implement the Tcl built-in commands, and
procedures that allow each application to extend Tcl with additional
commands specific to that application.  The application program
generates Tcl commands and passes them to the Tcl parser for
execution.  Commands may be generated by reading characters from an
input source, or by associating command strings with elements of the
application's user interface, such as menu entries, buttons, or
keystrokes.  When the Tcl library receives commands it parses them into
component fields and executes built-in commands directly.  For commands
implemented by the application, Tcl calls back to the application to
execute the commands.  In many cases commands will invoke recursive
invocations of the Tcl interpreter by passing in additional strings to
execute (procedures, looping commands, and conditional commands all
work in this way).

	An application program gains three advantages by using Tcl for
its command language.  First, Tcl provides a standard syntax:  once
users know Tcl, they will be able to issue commands easily to any
Tcl-based application.  Second, Tcl provides programmability.  All a
Tcl application needs to do is to implement a few application-specific
low-level commands.  Tcl provides many utility commands plus a general
programming interface for building up complex command procedures.  By
using Tcl, applications need not re-implement these features.  Third,
extensions to Tcl, such as the Tk toolkit, provide mechanisms for
communicating between applications by sending Tcl commands back and
forth.  The common Tcl language framework makes it easier for
applications to communicate with one another.

	Tk 3.0 - an extension to Tcl which provides the programmer with
an interface to the X11 windowing system.  Note that many users will
encounter Tk via the ``wish'' command.  Wish is a simple windowing
shell which permits the user to write Tcl applications in a prototyping
environment.

	Extended Tcl (tclX) 6.5c - This extended set of commands are
provided by NeoSoft, and provide additional Unix system interfaces to
the Tcl programmer.  Many users will encounter Tcl via the ``tcl''
command - an interactive Tcl command interpreter.

 ?? I do not have any info written yet for the language comparisons ??

------------------------------
Subject: -2- Do these packages run on my machine?

a. Unix

	Tcl runs on Suns and SunOS, DECstations running Ultrix, Dec
VAXen running Ultrix or BSD, Alphas running OSF, 386s running SCO Unix,
Xenix, Bell-Tech, Silicon Graphics running IRIX, HPs running HP-UX,
Sequent Symmetry running Dynix.

See the porting section below for info on porting the code to VMS as well.

	Tk (being based on Tcl) requires X11R4 or better as the only additional
software requirement.

b. MacOS

	Contact W. Ross Brown <ross@bnr.ca> for the current status of
the Tcl MacOS port.  Ross has a mailing list for discussion on that
topic.  

c. MS-DOS

	Two ports are available.  One unsupported port of Tcl and Extended 
Tcl 6.0, done by "Karl Lehenbauer" <Karl@NeoSoft.com>, is available on 
barkley.berkeley.edu.

	The other port of TCL V6.2 was done by 
"John Martin" <johnm@cajal.uoregon.edu> and is available via FTP from
cajal.uoregon.edu.

d. VMS

	A port of TCL 6.2 and Tk 1.4 to VMS was done by Angel Li
<angel@flipper.rsmas.miami.edu>.  The files are
mango.rsmas.miami.edu:pub/tcl-vms.bck.Z and
mango.rsmas.miami.edu:pub/tk-vms.bck.Z

and are compressed with the Unix compress command.  The files are 
VMS BACKUP files.


------------------------------
Subject: -3- Other than C, What languages can talk to tcl/tk?

a. Shell

	There are two standard interfaces which are shell-like.  The
first is wish, which is a windowing shell like interface that is a part
of the Tk package.  The second is tcl, a line command interpreter that
is part of the Extended TCL package.

b. C++

	Check out tcl++.h in Extended Tcl.  Based on an original
implementation by Parag Patel, it defines a Tcl interpreter class by
which Tcl interpreters can be created as objects under C++.

	Mark Diekhans and Karl Lehenbauer have used this, in
combination with the handle facility in Extended Tcl, to build Tcl
commands around C++ classes.

	The Tcl handle facility provides a way to manage table entries
that can be referenced by a textual handle from Tcl code.  This is
provided for applications that need to create data structures in one
command, return a reference (i.e. pointer) to that particular data
structure and then access that data structure in other commands.  An
example application is file handles.

	A handle table was built containing pointers to the instances
of a class that were to be accessed from Tcl, say a class `foo_cl', and
then a "new" command defined that created an instance of that class and
returned a Tcl handle to it.  The handle could then passed among Tcl
commands that accessed each member function.  The handle is in effect
an explicit `this' pointer.

	For example:

     set obj [foo_cl::new]
     foo_cl::baz $obj "Hello world"
     foo_cl::delete $obj

It's not totally object-oriented, but it's still very usable.

c. Modula-3

Norman Ramsey <elan.uucp!nr> says:

	A long time back, Eric Muller posted a Modula-3 interface to
the C TCL library.  I wrote down a Modula-3/TCL interface that used
Modula-3 types rather than C types, and that used objects to build
closures for commands.  I wrote part of the implementation but never
finished it.  I have mailed copies to carroll@udel.edu, who asked the
question, and I will post them if there seems to be general interest.

------------------------------
Subject: -4- Is there a bibliography of material relating to these 
		programs?

A. With the Tcl distribution there is a Postscript version of a Usenix
paper introducing Tcl.  With the Tk distribution, there is a Postscript
version of a Usenix paper introducing Tk.


Ousterhout, J.K., (1990) ``TCL: An Embeddable Command Language'', in
the Proceedings of the 1990 Winter USENIX Conference, pp 133-146.

Ousterhout, J.K., (1990) ``An X11 Toolkit Based on the TCL Language'',
in the Proceedings of the 1991 Winter USENIX Conference, pp 105-115.

Postscript file for introductory papers on Tcl and Tk are available in
the public FTP area on sprite.berkeley.edu (Internet address
128.32.150.27).  To retrieve them, ftp to sprite (login "anonymous",
password "guest") and type the following commands:

get tclUsenix90.ps
get tkUsenix91.ps
get tkF10.ps

(The last of these files is the contents of Figure 10 of the Tk paper)

If you have trouble retrieving the papers via FTP or printing them,
send bmiller@sprite.berkeley.edu your U.S. Mail address and he'll mail
you paper copies.

B. With the Expect distribution, there are several Postscript documents
available which have been published.

"Curing Those Uncontrollable Fits of Interaction", Proceedings of the
Summer 1990 USENIX Conference, Anaheim, CA, June 11-15, 1990.  (This
paper is discussion of implementation, philosophy, and design.  It is
pub/expect/seminal.ps.Z on ftp.cme.nist.gov.)

"Using expect to Automate System Administration Tasks", Proceedings of
the 1990 USENIX Large Systems Administration Conference (LISA) IV,
Colorado Springs, CO, October 17-19, 1990.  (This paper is discussion
and examples, specifically aimed at system administrators.  It is
pub/expect/sysadm.ps.Z on ftp.cme.nist.gov.)

"expect: Scripts for Controlling Interactive Programs", Computing
Systems, Vol. 4, No. 2, University of California Press Journals, 1991.
(A comprehensive paper of example scripts.  This paper is
pub/expect/scripts.ps.Z on ftp.cme.nist.gov.)

C. A FrameMaker MIF file containing a Quick Reference guide to Tcl is
available as barkley.berkeley.edu:/tcl/docs/QuickRef.tar.Z.  Thanks to
"Jeff Tranter" <Jeff.Tranter@software.mitel.com> for contributing it.

D. PostScript versions of the man pages were provided by 
"Adrian Ho" <adrianho@barkley.berkeley.edu>.  These are available on
barkley.berkeley.edu:/tcl/docs/tcl6.3.manps.tar.Z
barkley.berkeley.edu:/tcl/docs/tclX6.2b.manps.tar.Z
barkley.berkeley.edu:/tcl/docs/tk2.1.manps.tar.Z

E. An early draft of a text book based on Tcl and Tk, written by
John Ousterhout and to be published in 1993 by Addison-Wesley is available as
sprite.berkeley.edu:tcl/book.p1.ps.Z .  It is about 130 pages in length.
This is ONLY a draft.

F. A series of PostScript versions of slides used in a tutorial on 
Tcl and Tk at the 1992 X Conference are available as 
sprite.berkeley.edu:tcl/talk[1-5].ps and tkSquare.c.

Additional bibliographic references are still being sought.

------------------------------
Subject: -5- Where do I report problems, bugs, or enhancements - or -
		What is comp.lang.tcl?

	There are two alternatives for reporting bugs and problems.
The first is the USENET news group comp.lang.tcl, an unmoderated USENET
newsgroup, created for the discussion of the Tcl programming language
and tools that embed it, such as the Tk toolkit for the X window
system, expect, and Extended Tcl.  Please note that postings of source
code to comp.lang.tcl do not get archived to barkley.berkeley.edu - if
you want your code to be available from the User Contributions archive
you will need to make arrangements for someone to ftp it there.  See
elsewhere in the FAQ for more details on the archive site.

	The second would be to report problems, suggestions, new
ideas, etc. to the author.  Email to

ouster@allspice.berkeley.edu (John Ousterhout)

will get comments to the author of Tcl and Tk - for other programs, email
addresses are available either elsewhere in this part or part 3.

	Note: for those USENET-deprived individuals who are thus unable
to read comp.lang.tcl, a small echoing mailing list is available.
Contact John Ousterhout (see above for email address) for details.

------------------------------
Subject: -6- Where can I find the FAQ and who do I contact for more 
		information about it?

	I am going to attempt to keep a copy of this file up to date on
barkley.berkeley.edu.  Also, I will be posting it on a regular basis to
at least comp.lang.tcl and news.answers.

	If you have corrections, enhancements, modifications,
clarifications, suggestions, ideas, new questions, new answers to
questions which have never been asked, or something else that I have
not covered above, contact me at lvirden@cas.org.
-- 
Larry W. Virden                 UUCP: osu-cis!chemabs!lvirden
Same Mbox: BITNET: lvirden@cas  INET: lvirden@cas.org
Personal: 674 Falls Place,   Reynoldsburg, OH 43068-1614
-- 
Larry W. Virden                 UUCP: osu-cis!chemabs!lvirden
Same Mbox: BITNET: lvirden@cas  INET: lvirden@cas.org
Personal: 674 Falls Place,   Reynoldsburg, OH 43068-1614