🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #13921

Tcl - Tool command language

#13921
From: Karl Lehenbauer
Date: Tue, 27 Feb 1990 06:21
223 lines
11418 bytes
The following text was extracted from documentation that came with
the release of Tool command language I indirectly acquired from its 
author, Dr. John Ousterhout of the University of California at Berkeley.

If this looks interesting to you, you may be interested in getting a
copy of the alpha release of a port of this package over to the Amiga.
The README file for Amiga Tcl follows the overview.

If you would like me to email you a copy of the alpha release, please
let me know.  If a lot of people ask for it, I'll post it to 
comp.sources.amiga.  (If you're not willing to do some hacking on it,
it'd probably be best to wait for the beta release, at the very least.)

Regards,
Karl Lehenbauer, Hackercorp, 3918 Panorama, Missouri City, TX  77459


  Tcl -	overview of tool command language facilities


     INTRODUCTION
	  Tcl 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, Tcl	will eventually
	  provide a mechanism for communicating	between	applications:
	  it will be possible to send Tcl commands from	one
	  application to another.  The common Tcl language framework
	  will make it easier for applications to communicate with one
	  another.  The	communication features are not implemented in
	  the current version of Tcl.  [The Amiga version of Tcl
	  does support interapplication communication -karl]


----------
TclaREADME
----------

This is the alpha distribution of Tcl and Tcla.  Tcl stands for Tool
Command Language, and was created by Dr. John Ousterhout of the
University of California at Berkeley as a library package to be
embedded in various tools (editors, debuggers, terminal emulators, etc)
as the tools' command interpreter.  Tcl provides a simple programming
language, a set of built-in commands, and has a C interface that 
tools can use to add application-specific commands to the base set
provided by Tcl.

Tcla stands for Tool Command Language -- Amiga, and it provides several 
commands (via the C interface) that have been added to Tcl to support 
Amigas, including support for CLI commands, windows, menus, resources,
file requesters, alerts and message passing between Tcla programs.  
Tcla was created by Karl Lehenbauer of Hackercorp.

This package contains both Tcl and Tcla.  Tcl is essentially original Tcl,
with a small number of changes described below.  Tcl is copyrighted by
the University of California, but their copyright allows for reuse for any
purpose, including commercial sale, subject to the restriction that the 
copyright and disclaimer messages must be included unmodified where present 
(i.e.  in the source code).  Likewise, Tcla is copyrighted by Hackercorp, 
but we also allow redistribution for any purpose subject to the same
requirements regarding copyright and disclaimer messages.

Tcl and Tcla are compiled into libraries.  The TclTest C program, included
with Tcl, and the various test and demo C programs included with Tcla
can be linked with these libraries to produce executable programs that have
built-in Tcl interpreters, and at the programmer's option, Tcla extensions can
be included in one's programs to add Tcl command support for the CLI, windowing,
file requesters, alerts, menus and resources.  Further, Tcla programs have the 
ability to send and receive Tcl commands to and from other Tcla programs.

Tcl and Tcla should compile without trouble on Manx Aztec C 5.0a or later.
A port to Lattice should not be too difficult, the main work will probably
changing the makefiles, but this has not been done at the time of this
writing.

Changes in Tcl from Tcl as provided by John Ousterhout/Berkeley:

	o In original Tcl assigning an empty string to a variable caused
	  that variable to cease to exist, resulting in an error when you
	  tried to reference it.  This broke all sorts of little Tcl 
	  programs that should have worked.

	  Peter da Silva came up with changes to fix this, and Amiga Tcl 
	  incorporates this change.  The changes been forwarded to John 
	  Ousterhout (they were minor) and we expect that he will adopt 
	  them.

	o As a positive side effect of the above change, Tcl procedures that
	  can accept a variable number of arguments can now be called with
	  no arguments.  Previously if you defined a Tcl procedure as taking
	  a variable number of arguments, it required that at least one 
	  argument be passed.  This restriction was not true for C extensions, 
	  so now neither C extensions nor high-level Tcl procedures require an 
	  argument when the procedure expects a variable number of arguments.

	o The exec command has been removed.  This routine is system
	  dependent, and is now provided by the Tcla library.

	o ANSI function prototypes have been generated and are used to
	  enable type-checking when compiling Tcl and Tcla.  The tcl.h
	  and tcla.h include files declare function prototypes for all
	  C-callable Tcl and Tcla support routines to help insure
	  their correct usage.

	o Original Tcl did not concern itself with running out of memory.
	  This is understandable as it was developed and used on a virtual
	  memory machine (VAX) running Unix.  On the Amiga we have to be
	  more careful, because running out of memory is not such an uncommon
	  occurrence.  (This is an area within Tcl/Tcla that still needs
	  work.)

	o The panic routine that comes with Berkeley Tcl is present but
	  is not included in the Tcl library.  Users can provide their 
	  own panic routine (both Tcl and Tcla library routines call 
	  panic when they encounter various unrecoverable conditions) or 
	  use the one that is included in the Tcla library (the default).

The Tcl documentation consists of the Tcl manual and the Tcl C-interface
routines.  The file tcl.1 and all of the xxxx.3 files are Unix nroff/troff
files prepared using the "man" macros (nroff -man tcl.1, etc).  The manual 
and C-interface documentation is also provided as a straight ASCII text file 
(tcl.man and tcl.cman) for those who don't have access to Unix or otherwise 
don't care to nroff the manuals themselves.  (Note that the ASCII versions
have been stripped of all overstrikes, etc, so if you have nroff or troff
you may want to go ahead and use them to get listings with overstrikes, etc)


Known Bugs In Alpha Release
---------------------------

Some Tcla routines have some global data that should be instantiated
within the interpreter environment via the ClientData structure but
isn't.  Fixing this will also mean that in a future release the
initialization routines will require an argument of a pointer to the 
interpreter into which they are being instantiated.  PLEASE DO NOT
GENERALLY DISTRIBUTE CODE OR PACKAGES BASED ON THE ALPHA RELEASE.  WE 
DO NOT WANT TO HAVE TO MAINTAIN BACKWARD COMPATIBILITY TO THE MANY 
BRAIN-DAMAGED ASPECTS OF THE ALPHA RELEASE.

All of the routines to support windowing and menus are experimental.  They
do not support all the capabilities of Amiga windowing, menus, etc, by any 
stretch of the imagination.

Menus only work for one window.  (A serious problem... fix is in the works)

The intertask communications code works but doesn't always return all memory
used.  (A fix is being worked on.)

Tcla documentation is sparse.

The current Tcla event loop handling code is insufficient for complicated
tasks.  Users needing complex event loops will have to "roll their own",
using loop.c from the Tcla library source as an example for how to include
Tcla support in their loop.

The Tcl "exec" and "run" commands contain a great deal of common code
that should be extracted into a third routine.


Reporting Bug Fixes And Distributing Changes
--------------------------------------------

Please report bug fixes back to Hackercorp so that we may include them in
future releases.

Please don't release your own incompatible "core" version of Tcl unless
you have tried to contact us to get us to incorporate your changes or
enhancements and found us unresponsive.  

Wish List
---------

There is a lot of work to be done.  Here is my wish list:

	o Most pressing is probably to make Tcla into a shared library,
	  so only one copy will be resident.  Right now, having several
	  programs with Tcl interpreters chews up a lot of memory.

	o An ARexx interface.  Tcl looks to provide some tremendous
	  intertask communications capabilities, and is very simple
	  to use.  Nonetheless, ARexx already has become pretty standard
	  on the Amiga.  Well, we can have both if code is written to
	  pass messages between them, and Tcl looks to be an easy way
	  to provide a command interpreter for your ARexx port.

-- 
-- uunet!sugar!karl	"As long as there is a legion of superheros, all else
--			 can surely be made right." -- Sensor Girl
-- Usenet access: (713) 438-5018
Technical Details
Message-ID: <5213@sugar.hackercorp.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!texbell!sugar!karl

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!texbell!sugar!karl
From: karl@sugar.hackercorp.com (Karl Lehenbauer)
Newsgroups: comp.sys.amiga.tech
Subject: Tcl - Tool command language
Message-ID: <5213@sugar.hackercorp.com>
Date: 27 Feb 90 06:21:48 GMT
Reply-To: karl@sugar.hackercorp.com (Karl Lehenbauer)
Organization: Sugar Land Unix - Houston
Lines: 223