Newsgroups: gnu.misc.discuss,comp.lang.tcl,comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!news.sei.cmu.edu!cis.ohio-state.edu!math.ohio-state.edu!howland.reston.ans.net!europa.eng.gtefsd.com!MathWorks.Com!yeshua.marcam.com!charnel.ecst.csuchico.edu!olivea!sgigate.sgi.com!sgiblab!pacbell.com!amdahl!amd!netcomsv!netcomsv!ix.netcom.com!netcom.com!netcom7!mayer
From: mayer@netcom7.netcom.com (Niels P. Mayer)
Subject: Re: What should an alternative look like? was Re: Why you should not
In-Reply-To: peter@nmti.com's message of Tue, 27 Sep 1994 00:40:48 GMT
Message-ID: <MAYER.94Oct5131704@netcom7.netcom.com>
Sender: mayer@netcom.com (Niels P. Mayer)
Organization: NETCOM On-line services
References: <366u7n$9b7@agate.berkeley.edu> <kD30sc2w165w@sytex.com>
	<id.14CD1.4IL@nmti.com>
Date: Wed, 5 Oct 1994 20:16:59 GMT
Lines: 132
Xref: glinda.oz.cs.cmu.edu gnu.misc.discuss:18762 comp.lang.tcl:20012 comp.lang.scheme:10284


From: peter@nmti.com (Peter da Silva)
| In article <kD30sc2w165w@sytex.com>, Scott McLoughlin <smcl@sytex.com> wrote:
| > nweaver@madrone.CS.Berkeley.EDU (Nicholas C. Weaver) writes:
| > >     Would a byte code interpreter be fast enough, or would a more
| > > platform specific compiler be necessary, giving machine-code output?
| > Yup. For an "extension language" skip native code. BC is plenty fast.
| 
| Hell, for an extension language BC is almost overkill. Just grovel over the
| syntax tree directly in list format, taking advantage of the fast parsing you
| get from Lisp-type languages, the way Lisp-1.5 on the '11 did.  that'll save
| a couple of big chunks of code... for a lot of apps loading in the bytecode
| interpreter is as much overhead as parsing the lists.
| 
| And it'd make implementations and porting easier, which helps spread the
| system around. One thing you have to learn in the Lisp community is that
| making things easy for implementors is vital.

Sounds like you just described XLISP and it's progeny XLISP-PLUS,
XLISP-STAT, and WINTERP.

XLISP does exactly what you talk about -- grovelling directly over the
syntax tree produced by a relatively simple parser and macro-expander.  The
parsed results are what you pass on to your C-implemented primitives, and
there's a pretty clear "protocol" provided by a set of C functions and
macros which pull type-specified (or untyped) arguments off the evaluation
stack, retrieve C values from typed Lisp values. You then pass these values
on to your C code, do some processing, and call some more functions to
convert your C-types back to the appropriate (typed) Lisp values. For a
"real language" with types and garbage collection, it is suprisingly
straighforward. Furthermore, XLISP lets you do a lot of "Lisp" inside C, in
terms of tearing through arbitrary Lisp data structures, or returning
complex Lisp data structures -- this is extremely important in using the
extension language as "glue" into a large body of C functionality.

XLISP also helps you deal with exceptions and memory management in your
C-implemented code. Exception handling is dealt with nicely via C
primitives which signal errors to the Lisp interpreter. Automatic memory
management primitives are provided for cases where you're returning complex
Lisp data back to the interpreter from C. For many cases (including
exception handling) memory allocated in C code is automatically freed by
the interpreter. Yes, TCL is a bit simpler to extend at the C level, but
you pay for it with every single line of braindamaged TCL code that you
have to write.

(For information on interfacing to XLISP at the C level, see the
WINTERP 2.0 distribution file winterp/doc/XlispImpl.doc or use WWW
and browse http://www.eit.com/software/winterp/doc/XlispImpl.doc)

XLISP runs on a wide range of hardware -- from an 8088-based 640k IBM-PC
all the way up to a Cray. It also runs under many operating systems, such
as Unix, VMS, MVS, Amiga, Macintosh, OS/2, and others. WINTERP is Unix
specific due to extensive use of X11/Motif (but compiles and runs on any
Unix that supports X and Motif, including Linux), XLISP-STAT runs on
MS-WINDOWS, Macintosh, and X11/Unix.

XLISP is similar in size to TCL -- XLISP-PLUS 2.1f with all features
compiled in weighs in at 422k, whereas tclX 7.3 weighs in at 356k (SGI Irix
5.2 MIPS R4000). Run-time size of XLISP is probably a bit larger than TCL
because it uses type-tagged objects and automatic memory management via
garbage collection. On the other hand, XLISP looks like it is smaller than
Python, even though both languages support object oriented programming and
garbage collection.

Also, it seems that many people pass judgement on XLISP based on some of
the original articles about it in the early-mid eighties (e.g. XLISP
1.6). For example, most people don't realize that XLISP-PLUS now covers a
nice working subset of the Common Lisp standard, features lexical scoping,
etc. It has come a long way since XLISP 1.6, and it is much nicer language
than TCL, while maintaining all of TCL's speed/size/portability/extensibility
advantages. Yes, this is all IMHO...

For more info, see

* WINTERP
*               Niels P. Mayer
*               Enterprise Integration Technologies
*               800 El Camino Real, Fourth Floor
*               Menlo Park, CA 94025
*               mayer@eit.com or mayer@netcom.com
*
*       AVAILABILITY:
*               Latest version will be available via anonymous ftp from
*               ftp.x.org:/contrib/devel_tools/winterp-2.xx.tar.gz
*               (For latest version -- xx == 03)
*
*       INFORMATION:
*               WINTERP source availability information available by
*               sending e-mail to winterp-source@netcom.com (automatic reply).
*
*		WINTERP Home Page:
*			http://www.eit.com/software/winterp/winterp.html
*		
*		Usenet newsgroup comp.lang.lisp.x

* XLISP
* 	XLISP AUTHOR:
*		David Betz
*		167 Villa Ave. #11
*		Los Gatos, CA 95032, USA.
*		(408) 354-9303 (H)
*		(408) 862-6325 (W)
*		dbetz@Apple.COM (David Betz)
*		(posted to comp.lang.lisp.x 02 Apr 1992 by dbetz@Apple.COM)
*
*	XLISP-PLUS AUTHOR:
*		Tom Almy
*		17830 SW Shasta Trail
*		Tualatin, OR 97062, USA.
*		toma@sail.labs.tek.com
*
*	XLISP-STAT AUTHOR:
*		Luke Tierney
*		School of Statistics
*		University of Minnesota
*		Minneapolis, MN 55455, USA.
*		(612) 625-7843
*		luke@umnstat.stat.umn.edu
*
*	AVAILABILITY:
*		ftp latest version of XLISP-PLUS from
*		glia.biostr.washington.edu:/pub/xlisp/xlisp???.tar.Z
*
*	INFORMATION:
*		See newsgroup comp.lang.lisp.x for latest announcements and
*		discussions on XLISP, XLISP-PLUS, and XLISP-STAT.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
= Niels Mayer ..... mayer@eit.com .... http://www.eit.com/people/mayer.html =
=  Multimedia Engineering Collaboration Environment (MM authoring for WWW)  =
=  Enterprise Integration Technologies, 800 El Camino Real, Menlo Park, CA  =
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
