[request] Impressive Python Software

TERRENCE BRANNON (tb06@PL122e.EECS.Lehigh.EDU)
Fri, 15 Oct 93 15:01:32 -0400

I am getting ready to post another copy of my paper:
"Survey of Quick Interpreted Languages" to Usenet. However, before I do so, I
would like to know what impressive software has been developed with Python. I
am including a Beta copy of my paper. Note the chapter "Significant software"

Terrence Brannon ...... tb06@pl122e.eecs.lehigh.edu
Address ............... PO Box 5027, Bethelehem, PA 18015
Phone ................. 215-758-4081. 215-758-0780

\documentstyle{report}
\pagestyle{headings}
\begin{document}

\title {
Survey of Quick Interpreted Languages
}

\author {
Terrence Monroe Brannon \\
PO Box 5027 \\
Bethlehem, PA 18015 \\
$tb06@pl122e.eecs.lehigh.edu$
}

\maketitle

\tableofcontents

%%% 1. \part {Introduction} %%%

\part {Introduction}

The purpose of this FAQ is to expose people to several languages which
can cutdown/eliminate shell programming and C programming.

All of these languages are quick interpreted languages which can do
things in a few lines which might take hundreds of lines of C/shell
code.

These languages are evaluated in terms of the three things that any
programmer desires from a language: power, speed, and ease of use. Power
means a wealth of libraries for any task needed. Speed needs no
explanation. Ease of use includes how well documented the language is, how
much support there is for problems with the language, and how cleanly
extensible the language is.

\section {The Languages}
\begin{description}

\item[Scheme: Elk version]
Elk is a Scheme interpreter intended to be used as a general, reusable
extension language subsystem for integration into existing and future
applications. Elk can also be used as a stand-alone implementation of
the Scheme programming language.

One purpose of the Elk project is to end the recent proliferation of
mutually incompatible Lisp-like extension languages. Instead of
inventing and implementing yet another extension language, application
programmers can integrate Elk into their application to make it
extensible and highly customizable.

The Elk project was started in 1987 to support ISOTEXT, an ODA-based
document system (a WYSIWYG editor) that is being developed at the
Technical University of Berlin. Elk has been successfully demonstrated
as the extension language kernel of ISOTEXT, e.g. at the Hanover Fair 1989.

We feel that Scheme is better suited as a general extension language
than other Lisp dialects: it is sufficiently small to not dwarf the
application it serves and to be fully understood with acceptable
effort; it is orthogonal and well-defined. In addition, Scheme has
been recognized to be mature enough for national and international
standardization (IEEE P1178, ISO/IEC JTC1/SC22/WG16).

The Elk Scheme implementation is R4RS and P1178 conforming (with the
exception of the number system and a few other details that are listed
in the documentation).

Elk supports several additional language features to increase its
usability as an extension language, among them dynamic, incremental
loading of object files and `freezing' of a fully customized
application into a new executable file (`dump').

Other additional features of the Scheme implementation are:

\begin{itemize}
\item a simple macro facility
\item environments as first-class objects
\item dynamic-wind, fluid-let
\item autoloading, provide/require
\end{itemize}

The current release of Elk includes several dynamically-loadable
extensions, among them interfaces to the X11 Xlib and to the application
programmer interface of the Xt intrinsics, and interfaces to the Athena
and OSF/Motif widget sets.

As an alternative to the stop-and-copy garbage collector provided with
earlier versions of Elk, the Scheme interpreter now supports a
generational, incremental garbage collector. The generational garbage
collector is more efficient and thus reduces the time the application
is disrupted by a garbage collection. On platforms supporting advanced
memory management, the garbage collector can be switched to
`incremental' mode, further reducing wait times.

\item {Lisp: Emacs version}
Anything Emacs does is done in Lisp, so you can do it to. This means you
can have automatic completion of input, full screen editing, buffering
routines and much more. But you can only do it inside of Emacs Lisp for
the most part. The two work arounds are: (1) use emacs-server.el which
allows Emacs to send/receive onsockets (2) use emacs server mode. (3) I
am currently working on extracting the interpreter from Emacs so that it
is callable from C.

Emacs' only interaction with other programs is through its batch mode
which is callable from C or shell scripts. C programs cannot use Emacs
routines and Emacs cannot call C. Emacs can call shell scripts and
supply command line arguments as well.

\item[Perl]
Combines the best features of awk, sed, and shell programming. The
latest version can be embedded in C programs. It is also easy to call
from the shell.

The embeddable version, which is perl5, is not yet out for public release
quite yet. I would say that you should include C as "the best features"
of list, since one of its strong points is easy access to unix syscalls
and C library features.

Perl can be linked with external C libraries, such as curses or
database accessing libraries, like oracle or sybase, making for
easy access to screen-based form programs to deal with your dbase.

The Wafe server lets you get at X from perl.

\item[Python]
An object-oriented interpreted language. Callable from C as well as the
shell. Interpretation may be sidestepped through the use of the
byte-compiler on files. Python played a major role in testing Amoeba, a
distributed operating system developed at CWI.

\item[Tcl]
Extremely strong in X-windows. It can do a 5 page x-windows program in
*2* lines and more. Callable from C and from the shell.

\end{description}

\section{Obtaining}

All of these packages are publicly available via ftp.
I have chosen the ange-ftp method of representing ftp
connections for its conciseness. The following:
"/anonymous@src.doc.ic.ac.uk:/pub/gnu" means make an anonymous ftp
connection to src.doc.ic.ac.uk then cd to /pub/gnu.

As a side note, if you had Hyperbole (an Emacs-based hypertext package)
installed and running under X-Windows, you could just click on the
quotation-mark-enclosed pathname above and you would automatically be
connected to the above directory.

All documentation and source code have their copyright status with the
distribution. Consult the distribution for information on using these
products as part of your own creative work.

\begin{description}
\item[Emacs Lisp]
"/anonymous@src.doc.ic.ac.uk:/pub/gnu"
"/anonymous@prep.ai.mit.edu:/pub/gnu"
\item[Perl]
"/anonymous@convex.com:/pub/perl"
"/anonymous@archive.cs.ruu.nl:/DOC"
\item[Python]
"/anonymous@ftp.cwi.nl:/pub"
\item[Tcl]
"/anonymous@ftp.uu.net:/languages/tcl"
"/anonymous@barkley.berkeley.edu:/tcl"
\end{description}

\section{The Future}

\begin{itemize}

\item
Emacs Lisp does not have object-oriented extensions yet Python does.

Python does not yet have a robust ftp interface like Emacs' ange-ftp nor
does it have an advanced desk top calculator like Emacs's calc. However
it does have STDWIN, an easy-to-use windowing system.

Expression of mathematics in Tcl is cumbersome yet X11 graphics is very
very easy.

Perl has excellent string and manipulation tools and a ton of sysadmin
utilities written in it.

The bottom line is that all of these languages have powerful tools ready
to use. Each language also has its weak points. Instead of being stuck
in each language and slaving through its weakness (or lack of a certain
utility), one should be able to fire up an interpreter in any of these
other languages and let it perform on it strong points and return the
answer.

I expect this type of hybrid programming to become almost necessary with
excellent packages and large being written for each langauge.

\item
I am currently working on socketed interprocess communication between a
Python interpreter and Emacs Lisp. Next will be Tcl. Perhaps next will
be postscript or maybe Perl.

\item
A trans-language browser. If you see that a Perl script has been
written to traverse a directory tree and count the number of files
ending in .o whose age is more than 20 days but you are not a Perl
programmer, that Perl script should become and OBJECT to which you SEND
a message to get that work done.

\end{itemize}

%%% 2. \part {Power} %%%

\part {Power}

%%% 2.1. \chapter {Significant Software} %%%

\chapter {Significant Software}
An important feature of these languages is how much is already there for
you to use.

%%% 2.1.1. \section {Emacs Lisp} %%%

\section {Emacs Lisp}

\begin{description}
\item[Folding Mode] Allows for hierarchical editing of structured text
files. I use it all the time. You can move through and edit any document
(program, LaTeX file, whatever) much faster using folding mode.
\item[VM] A mail reader that does everything that I need.
\item[Gnus] A Usenet reader that can save articles to mail folders for
later recall. I often save articles in Gnus and later read them using VM.
\item[EDB] full featured database
\item[Ange-FTP] An excellent ftp utility which allows transparent
file access/modification with the ease of a few keystrokes.
\item[user interfaces] Countless interfaces for everything from Archie to
MUD role playing games.
\item[AUC-TeX] Allows you to do anything you would want to do with
TeX/LaTeX from an Emacs buffer quickly and easily.
\item[Calc] The poor man's Mathematica. Includes rewrite rules and
functionality on the order of the HP-28.
\item[VIP] vi emulation for emacs
\item[Calendar/Diary] Calendar and appointment manager within Emacs
\item[Tree Dired] Allows you to scroll through directories and copy, edit,
remove, view files. And more
\item[Hyperbole] Extensible hypertext management system within Emacs.
\end{description}

%%% 2.1.2. \section {Perl} %%%

\section {Perl}
Having been publicly available for six years now, Perl has a truly huge
body of code already written for it. I couldn't begin to document all of
them. More than any other language listed herein, it is the tool of
choice for Unix system administrators. Perl comes with a symbolic
debugger, a bunch of libraries, various tools, and and numerous example
programs, but that's just the start.

%%% 2.1.3. \section {Python} %%%

\section {Python}
\begin{enumerate}
\item
?? -- Multimedia interface.
\item
?? -- Remote Procedure Call debugger
\item
texfix -- Crude convert latex to texinfo
\item
throughput -- measure tcp throughput
\item
dutree -- format du(1) output at a tree sorted by size
\item
findlinks -- recursively find links to a given path prefix
\item
lpwatch -- watch BSD line printer queues
\item
suff -- sort a list of files by suffix
\end{enumerate}

%%% 2.1.4. \section {Tcl} %%%

\section {Tcl}
\begin{enumerate}
\item[Tcl-DP] Layered distributed computing for Tcl. Tcl-DP adds TCP and IP
connection management, remote procedure call (RPC), and distributed object
support to Tcl
\item[Extended TCL] Adds keyed lists, a debugger and profiler and the full
suite of Unix process control primitives to Tcl.
\item[Objectify] Turns C++ classes into Tcl objects.
\item[Artcls] A graphic Usenet newsreader.
\item[TkWWW] A Tk world-wide web browser.
\item[XF] An X11 user interface builder
\item[WAFE] {\it W}idget {\it A}thena {\it F}ront {\it E}nd. Implemented in
Tcl, this package allows for the same generic graphic commands to be used
to develop user interfaces regardless of what language you are programming
in. All you need to do is interface to WAFE from your language.
\item[PhotoWidget] A photo widget for Tk.
\item[TSipp] A Tcl interface to the SIPP 3-D rendering library.
\item[TkSteal] Allows for a Tk program to have an Emacs widget or a
Ghostscript widget.
\item[Pixmap] A color pixmap editor written in Tcl/Tk
\item[VOGLE] Awesome full-color 3-D rendering package with a ton of
fonts, both american and foreign.
\end{enumerate}

%%% 2.2. \chapter {Graphics} %%%

\chapter {Graphics}

\section{Emacs Lisp}
None internally, but the ability to spawn inferior unix
processes and issue shell commands allows it to use tcl's WAFE or fire
up a Python process and control it with ease.

\section{Perl}
Again none interally, but the author of WAFE, the tcl/tk graphic
interpreter wrote all of his example programs in Perl (wafemail,
wafenews, wafeftp).

Certainly perl can issue external commands (inferior processes in lisp
parlance). There is also a version of guiperl I've seen Larry demo
for me, so there's at least proof-of-concept that you can link in
the X libs. Whether it will come out with perl5 I don't know.

\section{Python}
Through the use of the STDWIN paradigm, the same source code
can do graphics in the following systems:

\begin{enumerate}
\item
X-windows
\item
Macintosh using either Think C 4.02 or MPW C 2.02
\item
Atari ST
\item
DOS
\item
Silicon Graphics SGI workstations
\end{enumerate}

This approach allows flexibility but means that no one graphics system's
potential is maximized.

\section{Tcl}
Overloaded with all types of very very easy to do attractive
graphics in X-Windows only. Easy to learn, and has many nice widgets
added to it such as a photo widget for display of scanned PBM images,
a bar graph widget, an editable text widget and much more.
Powerful tcl-based graphics systems come to mind:

\begin{enumerate}
\item
xy-graph - includes a Hypertext widget. This means that regardless of
what stream of information comes at your Tcl program, you can create
windows and paths through the stream on the fly. A major example of the
hypertext widget is Joseph Wang's World Wide Web Hypertext browser.
\item
VOGLE - 3D rendering, fonts
\item
BYO Interface Builder. A snap to use.
\item
XF - Another interface builder by the developers of TkEmacs. Arguably
as good as BYO.
\item
WAFE . Send text string from anywhere (C language, Emacs, shell) to
a server and have the graphics done for you.
\item
BOS - An object oriented extension for Tcl which also has some
widgets added to it.
\end{enumerate}

%%% 2.3. \chapter {User Interface Building} %%%

\chapter {User Interface Building}

\section{Emacs Lisp}
None internally, but the ability to spawn inferior unix
processes and issue shell commands allows it to use tcl's WAFE or fire
up a Python process and control it with ease.

\section{Perl}
Again none interally, but the author of WAFE, the tcl/tk graphic
interpreter wrote all of his example programs in Perl (wafemail,
wafenews, wafeftp).

Certainly perl can issue external commands (inferior processes in lisp
parlance). There is also a version of guiperl I've seen Larry demo
for me, so there's at least proof-of-concept that you can link in
the X libs. Whether it will come out with perl5 I don't know.

\section{Python}
Through the use of the STDWIN paradigm, the same source code
can do graphics in the following systems:

\begin{enumerate}
\item
X-windows
\item
Macintosh using either Think C 4.02 or MPW C 2.02
\item
Atari ST
\item
DOS
\item
Silicon Graphics SGI workstations
\end{enumerate}

This approach allows flexibility but means that no one graphics system's
potential is maximized.

\section{Tcl}
Overloaded with all types of very very easy to do attractive
graphics in X-Windows only. Easy to learn, and has many nice widgets
added to it such as a photo widget for display of scanned PBM images,
a bar graph widget, an editable text widget and much more.
Powerful tcl-based graphics systems come to mind:

\begin{enumerate}
\item
xy-graph - includes a Hypertext widget. This means that regardless of
what stream of information comes at your Tcl program, you can create
windows and paths through the stream on the fly. A major example of the
hypertext widget is Joseph Wang's World Wide Web Hypertext browser.
\item
VOGLE - 3D rendering, fonts
\item
BYO Interface Builder. A snap to use.
\item
XF - Another interface builder by the developers of TkEmacs. Arguably
as good as BYO.
\item
WAFE . Send text string from anywhere (C language, Emacs, shell) to
a server and have the graphics done for you.
\item
BOS - An object oriented extension for Tcl which also has some
widgets added to it.
\end{enumerate}

%%% 2.4. \chapter {String Handling} %%%

\chapter {String Handling}

\section{Emacs Lisp}
Strong. Many good string handling functions for operation on buffers as
well as string. Search replace backward and forward with regexps. Many
good string handling functions are found in tree-dired.el in gmhist*.el.
As well as in ange-ftp.el.

\section{Perl}
Very strong.

String-handling is one of Perl's strongest features: they are quite
powerful and extensive. Strings can be as long as you want, and contain
binary data and nulls. This works:
\begin{verbatim}
$kernel = `cat /vmunix`;
\end{verbatim}

Perl has a wealth of string-accessing functions, including matching,
substitution, transliteration, splitting, and direct substring accessing.
Strings and numbers are interchangeable. The regexps are a superset of
other regexp syntaxes, with extensions. Parsing is very easy:
\begin{verbatim}
($name, $number, $host) = /(\w+)=(\d+)( from @(\w+))?/;
\end{verbatim}
Subexpressions can nest, and be arbitrarily deep: you don't have
to stop with \\9, but can keep going.

Perl's substitution operator works like sed's:
\begin{verbatim}
s/foo/bar;
\end{verbatim}
or
\begin{verbatim}
$a =~ s/foo/bar/g;
\end{verbatim}
but can do much more, like:
\begin{verbatim}
s/(\d+)/sprintf("0x%08x", $1)/ge;
\end{verbatim}
to find all the numbers in the pattern space and replace them
with the hex representation of the same. It has other powerful
features I don't have time or space to go into.

Perl also lets you treat strings as raw bitwise data, so
\begin{verbatim}
substr($a,0,3) &= "\177\177\177";
\end{verbatim}
would clear the high bits on the first 3 bytes of \$a. You
can also access strings bitwise, say, to check the $2456$th bit
of a string.

\section{Python}
It has a string module and regexp module. It has all the string
@emph{search} capabilities of Emacs, but since strings are immutable in
Python, it understandably does not have Emacs Lisp's string replace power.

\section{Tcl}
Everything in Tcl is a string. It is very easy to map certain
string-intensive applications to Tcl. For example, I wrote a program to
do parallel library database searches in Tcl in about two weeks. Ranking
the 4 languages in terms of how easy it would have been: Tcl, Python,
Emacs, and I cant say about Perl because I gave up on Perl quickly after
buying the book and seeing all those registers and the confusing
context-intensive syntax.

%%% 2.5. \chapter {Process Control} %%%

\chapter {Process Control}

\section {Emacs Lisp}
Has specialized modes for controlling Common and other lisps to
facilitate debugging, execution, and programming. Has shell modes with
command history. Has an excellent ftp program (ange-ftp). Can
asynchronously or synchronously call the shell and store the output in a
buffer or string. Can filter output from a process. However, the
filtering is somewhat hairy because you cannot be sure of the packet
size that the data will arrive in. In other words, it is easy to open a
pipe with Perl/Python/Tcl and just read lines at a time but you have to
write an accumulator function to do this in Emacs Lisp. However, the
interactor mode for GNU Smalltalk has an excellent accumulator function
that you could use in your own code.

\section{Perl}
Perl has all the process control primitives available to you from C, plus
higher level constructs as well. It's easy to open a pipe to or from
another process. You can even open a pipe to an implicitly forked version
of yourself. Standard Perl library routines allow bidirectional pipes
and running things over a pty via a package that works much like Don
Libes's Expect, save that it uses Perl instead of tcl as an extension
language. Perl can also access all the socket and ipc functions on your
system without calling a program to do it.

\section{Python}
You would use pipes to do this in Python.

\section{Tcl}
Even stronger than Emacs. A package by Don Libes called Expect allows
the programmer to specify a set of expected regexps from the process and
what to do upon the receipt of the process output. Several of his papers
including "expect: Curing Those Uncontrollable Fits of Interaction"
available in postscript format for anonymous ftp from durer.cme.nist.giv
in pub/expect.

There are also numerous process control extensions in Extended Tcl,
which will be detailed in the section titled extensions.

%%% 2.6. \chapter {Sample Programs} %%%

\chapter {Sample Programs}

To give you a taste of how each of these languages does its thing, I
have created some simple programs to give you an idea of how easy each
language can do some routine tasks.

None of the programs have been written for any of the languages for
this version of the FAQ. If you would like to contribute source, feel
free. Or if you have a program done in one of these languages that you
think would have been very difficult in one of the others let me know.

The programs are:

\begin{enumerate}

\item Write a program to count the number of files in the current directory.

\section{Emacs Lisp}
\begin{verbatim}
(defun current-directory-size ()
``Number of files in the current directory.''
(length (directory-files ``.''))
\end{verbatim}

\section{Perl}
\begin{verbatim}

#!/usr/bin/perl
$count = @files = <*>;
print "Directory file count: $count\n";

#!/usr/bin/perl
$count++ while <*>;
print "Directory file count: $count\n";

#!/usr/bin/perl
print "Directory file count:", `ls | wc -l`;

# those didn't have dot files. if you want dot files,
# use <* .*> instead.

#!/usr/bin/perl
opendir(DOT, '.');
$count = @files = readdir(DOT);
print "Directory file count: $count\n";

#!/usr/bin/perl
opendir(DOT, '.');
$count++ while readdir(DOT);
print "Directory file count: $count\n";

\end{verbatim}

\section{Tcl}
\begin{verbatim}

set count [ls | wc -l]

\end{verbatim}


\item
Write a program to run under X-Windows and Macintosh which opens a
window and prints {\tt "Hello, World"} in it.

\section{Emacs Lisp}
\begin{verbatim}
(defun hello-world () ; FSF Emacs 19 only.
``Open new frame with a friendly greeting.''
(switch-to-buffer-other-frame ``*hello world*'')
(insert ``Hello, World''))
\end{verbatim}

\section{Perl}
\begin{verbatim}
I'd just talk to Wafe or Stdwin. Or call xterm. :-)
\end{verbatim}

\section{Tcl}

\begin{verbatim}

button .hello -text {Hello, World} -command {exit}
pack append . .hello {top}

\end{verbatim}

%---------------------------------------------------------------

\item
Given a file with 4 occurrences of the string "Hello Bob" find the file,
replace the last 3 occurrences of "Hello Bob" with "Hi James" and save
the file. The double quotation marks are for delineation purposes only.

\section{Emacs Lisp}
\begin{verbatim}
(defun Bob-meet-James (file)
``Replace all `Hello Bob' with `Hi James' in FILE except the first.''
(save-excursion
(find-file file)
(goto-char (point-min)) ; We might already be editing it...
(search-forward ``Hello Bob'')
(while (search-forward ``Hello Bob'' nil t)
(replace-match ``Hi James''))
(save-buffer)))
\end{verbatim}

\section{Perl}
\begin{verbatim}
# the orig file will be in file.BAK -- if you don't want a backup,
# use just -i.

# remember that s//foo/ will match the last match

perl -i.BAK -p -e '/Hello Bob/ && $seen++ && s//Hi James/g'

or
perl thisprog < file.in > file.out

#!/usr/bin/perl
while (<>) {
if (/Hello Bob/ && $seen++) {
s//Hi James/g;
}
print;
}
\end{verbatim}

\section{Tcl}

\begin{verbatim}

set fdIn [open testFile r]
set contents [read $fdIn]
regexp -indices "Hello Bob" $contents matches
regsub -all "Hello Bob" \
[string range $contents [expr [lindex $matches 1]+1] end] \
"Hi James" result
close $fdIn
set fdOut [open testFile w]
puts $fdOut [string range $contents 0 [lindex $matches 1]]$result \
nonewline
close $fdOut
exit

\end{verbatim}


\item
A lengthy file has been entered with records of the form:
\begin{verbatim}
<\n>NAME<\n>ADDRESS<\n>PHONE<\n>----------
\end{verbatim}
where \begin{verbatim}<\n>\end{verbatim} represents a line feed and the
\begin{verbatim}----------- \end{verbatim} is used to
separate records. Convert all entries in the file to a new format of
the form:
\begin{verbatim}<\n>NAME::ADDRESS::PHONE}
\end{verbatim}

\section{Emacs Lisp}
\begin{verbatim}
(defun newline-to-double-colon ()
``Convert current buffer from old style to new style address book
format.''
(goto-char (point-min))
(while (re-search-forward
``\n\\([^\n]*\\)\n\\([^\n]*\\)\n\\([^\n]*\\)\n----------'' nil t)
(replace-match ``\n\\1::\\2::\\3'')))
\end{verbatim}

\section{Perl}

\begin{verbatim}

#!/usr/bin/perl
$/ = "\n----------"; # set record separator
while (<>) { # read a record
s!$/$!!; # remove record terminator
s/^\n//; # trim first line feed
s/\n/::/g; # turn rest into double dolon
print "\n"; # new record starts with \n
print; # output current pattern space
}

# Did you know that the last record in the file will no longer
# have a terminating newline? Make sure the others get this right.
\end{verbatim}

\section{Tcl}

\begin{verbatim}

set fdIn [open testFile r]
set contents [read $fdIn]
regsub -all "^\n" $contents "" contents
regsub -all "\n" $contents "::" contents
regsub -all "::----------::" $contents "\n" contents
close $fdIn
set fdOut [open testFile w]
puts $fdOut $contents nonewline
close $fdOut
exit

\end{verbatim}

\end{enumerate}

%%% 3. \part {Speed} %%%

\part {Speed}

%%% 4. \part {Ease of Use} %%%

%%% 4.1. \chapter {Documentation/Support} %%%

\chapter {Documentation/Support}

\section{Emacs Lisp}
Excellent. Both for using Emacs and programming Emacs Lisp.

\section{Perl}
Excellent. A book is out by Larry Wall called Programming in Perl. The
manual page is 80 pages typeset. The newsgroup comp.lang.perl is very
active and helpful and the newsgroup archives are available
on-line, and come with literally thousands of code snippets and fully
fledged programs doing more different things than I can begin to
enumerate. There is also an excellent quick reference guide, and
professionally-taught courses for Perl available.

\section{Python}
Good. Covers everything but how to extend Python through C.

\section{Tcl}
Good. The Tcl book is due out soon.

\chapter{Program Development}

\section{Emacs Lisp}
The best. Has a debugger. Since you are in Emacs, you can immediately
test whatever you are writing. Documentation on every function and
variable in memory is available in 2 keypresses. The tags system allows
you to jump to functions and global variable declarations without
knowing which file they are in.
\section{Perl}
I would say strong. To use Perl, you only need to know a little bit to
start to use it. The interactive debugger allows you to type any kind of
Perl code you want and get an immediate answer, as well as providing
standard sym debugger capabilities such as breakpoints, single-stepping,
and stack tracebacks. Other tools available but not included with the
Perl src kit include profilers, tags generators, cross referencers, and
tools to assemble large Perl programs using makefiles and a lintlike
checker. Other tools provide perl-mode for vi as well as tightly coupling
the debugger with a slave vi session that autopositions by file and line.

\section{Python}
Good. The concept of immutable strings takes some getting used to.

\section{Tcl}
The language is very consistent --- every line is
started with a command which is the name of a Tcl or C function. The
rest of the line is arguments to the Tcl or C function.

%%% 4.2. \chapter {Extensibility} %%%

\chapter{Extensibility}

When I say extensibility I mean the ability to add a new keyword or data
type to a language as opposed to adding a new utility.

\section{Emacs Lisp}
Writing new lisp functions is only feasible by using the
already-available lisp functions. To write new lisp functions in C would mean
re-compiling Emacs every time.

\section{Perl}
You can extend Perl through linking with C routines. The example
with the perl kit explains how to do this for the curses library,
but can be done for many other applications as well. This is adding
new function calls.

What I don't think is easy is changing the perl syntax.

What you would probably do is define a package and use acccessor
functions. I did this to allow perl user's to get at C struct and union
types to interract with C programs. A package is semi-reminiscent of a
C++ class, perhaps best described as a protected namespace with private
and public data declarations and initialization code, as well as both
private and public functions. I wonder how the other languages stack up
on this kind of thing.

\section{Python}
Its possible in C. How to do it in C is not well documented.

\section{Tcl}
Its possible and well-docuemented and has been down well by many
people in C.

\chapter{Test Suite}

\section{Emacs Lisp}
Well, if you compile Emacs then Emacs Lisp will run. This is
irrelevant criteria for Emacs Lisp.

\section{Perl}
Perl comes with an exhaustive test suite.

\section{Python}
Exhaustive test suite
\section{Tcl}
Exhaustive test suite

%%% 5. \part {The Future} %%%

\part {The Future}
\section {More Languages}
\section {More Examples and Tests}
\section {Multiple Computer Language Programming}

\end{document}