comp.lang.ada
 help / color / mirror / Atom feed
From: hen@bu-cs.UUCP (Bill Henneman)
Subject: Re: Speed with numbers: PDP-10 Maclisp vs. Fortran (details)
Date: Tue, 19-Mar-85 11:15:13 EST	[thread overview]
Date: Tue Mar 19 11:15:13 1985
Message-ID: <272@bu-cs.UUCP> (raw)
In-Reply-To: 320@cmu-cs-k.ARPA

Um, I think I made a careless error.  I have been responding to messages
in net.ai without checking the cross-listings of the postings.  I
phrased my reply under the misapprehension that I was conversing with an
experienced LISP user.  My curt reply was based on a wrong model of how
elliptic I could be.  The only thing I accused you of was basing an
argument on experience you didn't have.  I'll start over.

If you say that PASCAL or ADA ought to be able to link FORTRAN library
routines, I'll interpret the statement as a comment about the benefits
gained from using carefully crafted library packages like the IMSL
routines vs. the cost of accommodating the linkage.  Any compiler builder
will agree - something like the support required has to be there, the
cost of accommodation is small, the benefit is great.  It ought to be
done.  

But LISP is not some sort of Cambridge Polish form of FORTRAN.  It makes
different assumptions about the computing environment.  LISP is
interpreted, and has a rather devil-may-care attitude about errors,
since it can inspect the entire run time environment to take corrective
action.  The FORTRAN compiler inserts certain implicit assumptions about
the run-time environment into compiled code, and refuses to compile
"dangerous-looking" code, because it can't see the run-time environment.

While most LISPs I am familiar with can load FORTRAN library routines,
none fully support them.  As a simple example of the difference between
allowing alien routines to be called and supporting their use, consider
the trivial problem of linking to SQRT from LISP.  This does involve a
trivial reformatting of numbers to support the call. No problem - float
the number if necessary, build the calling sequence and call SQRT.  But
what happens if SQRT detects what it thinks is an error condition (such
as a negative number being passed)?  Who gets to handle the problem?
SQRT assumes the presence of a fairly elaborate run-time support module
to handle error messages, and in this case to provide standard fix-ups.
Does the LISP user get a FORTRAN error message with the answer
canonically set to 0, or a LISP error break?  The only answer
acceptable to the LISP user is to be thrown into the LISP error break,
so the FORTRAN error handler has to be trapped by a special LISP module
to support the FORTRAN run-time routine.

Building such a beast is a non-trivial job, since you have to take into
account all the different ways FORTRAN routines might react to error
conditions.  Some FORTRAN library routines depend on interrupt handlers
being present, or specific interrupts being masked off.  Some FORTRAN
graphics library routines feel free to use the complete I/O capabilities
of the machine.  In fact, in order to provide LISP functions with the
ability to use the FORTRAN routines called, LISP ends up having to
simulate (and override) the full run-time environment of FORTRAN.  This
simulation is a complete add-on, since LISP treats all such
environmental issues in a completely different fashion.

And so, we come to my assertion that you might as well try to link
SNOBOL routines.  Well, if you have provided the full run-time support
for FORTRAN library routines, you get SNOBOL support essentially for
free!  Read "The Macro Implementation of SNOBOL 4" by Ralph E. Griswold
to see how much SNOBOL relies on the FORTRAN environment. 

In order to get the benefit, you have to pay the cost.  The cost in the
case of PASCAL supporting FORTRAN library routines is paid in how you
code a module which in some form or another had to be there anyway, and
the user sees nothing but benefits.  The cost in the case of LISP
supporting FORTRAN library routines is paid in designing a module which
allows things to be done in a way inconsistent with the way everything
else is done in LISP, leading to code which is difficult to maintain, an
interface which is impossible to document, and a very angry user
community.  It just isn't worth it.

  parent reply	other threads:[~1985-03-19 16:15 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1985-02-14 15:59 Thus spake the DoD Frederick J Dickey
1985-02-17  1:58 ` Robert Hofkin
1985-02-17 16:36 ` g-frank
1985-02-18  5:18   ` Skef Wholey
1985-02-18 14:33 ` Chuck Hedrick
1985-02-19 19:09   ` Daniel J. Salomon
1985-02-22  2:21     ` LISP &c (re: the DoD...) Thomas M. Breuel
1985-02-25 17:08     ` Thus spake the DoD Jan Steinman
1985-02-26 23:20     ` Stanley Shebs
1985-02-27 19:22       ` Daniel J. Salomon
1985-03-01 19:30         ` Stanley Shebs
1985-03-01 20:13         ` neves
1985-03-02  4:33         ` Thomas M. Breuel
1985-03-02 18:35           ` Efficiency of LISP Marty Sasaki
1985-03-03  0:23         ` Language criticism Greg Davidson
1985-03-06 14:13         ` Thus spake the DoD geb
1985-02-28  3:16       ` David Schachter
1985-03-01 19:00         ` Stanley Shebs
1985-03-03  3:08         ` Joaquim Martillo
1985-03-03  6:12         ` T J Jardine
1985-03-05 16:55           ` Jan Steinman
1985-03-05 21:07           ` Robert A. Pease
1985-03-12  1:47           ` Ed Colbert
1985-03-13 19:35       ` Monique M Taylor
1985-03-17 19:49         ` Jan Steinman
1985-03-21  1:17           ` faustus
1985-03-12  0:25     ` Efficiency of LISP Stavros Macrakis
1985-03-12  2:11     ` Efficiency of numerical Lisp code (details) Stavros Macrakis
1985-03-13  7:05     ` Chuck Hedrick
1985-03-13 20:00     ` Speed with numbers: PDP-10 Maclisp vs. Fortran (details) Stavros Macrakis
1985-03-14 10:12       ` Tim Maroney
1985-03-15  0:27         ` Bill Henneman
1985-03-16  0:59           ` Tim Maroney
1985-03-17 18:58             ` Bill Henneman
1985-03-18  5:02               ` Multi-language systems Marty Sasaki
1985-03-20 17:01                 ` Tom Slack
1985-03-18 21:24               ` Speed with numbers: PDP-10 Maclisp vs. Fortran (details) Tim Maroney
1985-03-19  6:45                 ` Fortran better than Lisp for numerical code? Barry Margolin
1985-03-19 17:35                   ` Speed of Lisp numerical code Stavros Macrakis
1985-03-20 21:04                   ` Fortran better than Lisp for numerical code? T J Jardine
1985-03-22  2:10                     ` Joe Orost
1985-03-19 16:15                 ` Bill Henneman [this message]
1985-03-19  3:40               ` Speed with numbers: PDP-10 Maclisp vs. Fortran (details) Norman Diamond
1985-03-18  3:01             ` Common Lisp and Arrays Joaquim Martillo
1985-02-18 23:49 ` Thus spake the DoD M.Fischer
1985-03-14 20:50 ` Speed with numbers: PDP-10 Maclisp vs. Fortran (details) Stavros Macrakis
1985-03-15 15:42 ` Stanley Shebs
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox