Newsgroups: comp.lang.lisp,comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!portc01.blue.aol.com!portc02.blue.aol.com!howland.erols.net!news.nacamar.de!fu-berlin.de!cs.tu-berlin.de!news.uni-hamburg.de!news.Hanse.DE!wavehh.hanse.de!cracauer
From: cracauer@wavehh.hanse.de (Martin Cracauer)
Subject: Re: Foreign Functions (was Re: Why lisp failed in the marketplace)
Message-ID: <1997Feb26.110324.27109@wavehh.hanse.de>
Reply-To: cracauer@wavehh.hanse.de
Organization: '(a (cons tructive organization))
References: <5eg0oj$tbb@Masala.CC.UH.EDU> <5eg59n$33h@fido.asd.sgi.com> 	<BITMEADC.97Feb21101625@Alcatel.com.au> 	<1997Feb24.110601.16097@wavehh.hanse.de> <SCHAUER.97Feb25111408@hamlet.zeus.gmd.de>
Distribution: inet
Date: Wed, 26 Feb 97 11:03:24 GMT
Lines: 85
Xref: glinda.oz.cs.cmu.edu comp.lang.lisp:25764 comp.lang.scheme:18954

schauer@zeus.gmd.de (Holger Schauer) writes:

>>>"MC" == Martin Cracauer schrieb am Mon, 24 Feb 97 11:06:01 GMT:

> >> The bigger problem here is the lack of a stardard C interface for
> >> lisps. Until that exists, any package, such as Winterp will only
> >> run on top of the lisp version it was built for.

> MC> I don't think that makes too much sense. The semantics of alien
> MC> integration for the various implmentations of Lisp are too
> MC> different. Just a few points:
>[list of points deleted]
> MC> An then, most important, how will you handle cases where the lisp
> MC> runtime lacks one of these features? For good performance, there
> MC> is no other way than to conditionalize code on the base of lack
> MC> or suport of features.

>So, would you say that it is not possible to define such a standard
>interface because it would require uniform implementation details ?
>Or would you say it is possible but not very probable that
>lisp-vendors (free lisp vendors alike) can and will standarize on
>such an interface ?

I would say that a standard alien interface that keep performance loss
to a minimum would be:

1) so complex that it is very hard to learn, maybe harder than
learning several individual alien interfaces.

2) using it with performance in mind would still require a lot of
conditionalization of code on the base of the supported features
(namely neccessary conversions).

The difference would be that you conditionalize your code on the base
of alien features, not Lisp implementations.

I.e.: #+alien-no-string-conversion instead of #+cmu

If someone doesn't have the need for optimal performance, I think the
macro used by ILU is just fine. The fact that people didn't jump on it
and implemented it for every CL implementations show somewhat that
such a simple interface is not of real interest for people.


I think defining a standard alien interface that is a full superset of
existing interfaces is not worth the effort. You will still have to
conditionalize and I don't think the time required to design and
implement for the abstractional layer "standard alien" will not pay
off. 

And all this discussion is just about defining the interface between
Lisp and alien code.

We didn't even touch of problem of actually loading alien code. Not
all Lisp implementations can load object files of the underlying
implementation. Some require linking it in, which from the logical
view of the alien interface means that loading alien code requires to
restart the whole Lisp image. You definitivly want to coditionalize
your code on that fact.

>I think from the user's point of view a standarized foreign-function
>interface would be great. There is no doubt that such a thing will
>involve a lot of difficulties and work for the lisp vendors. On the
>other hand, I could imagine that if we had such a standarized
>interface lisp could also gain some more popularity.

IMHO, more popularity would not be the result of an standard alien
layer, but the result of applications thereof.

The question is: What applications do you think of? How many of these
implementations can be implemented on top of a subset of available
alien interfaces. Is performance important for these applications?

For my own work, I found that every use of aliens required good
performance. And please keep in mind that I don't use aliens to
replace Lisp code for better performance, my implementation is usually
fast enough. I use aliens for system access and to reuse existing C
libraries (i.e. regular expressions).

Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin_Cracauer@wavehh.hanse.de http://cracauer.cons.org  Fax.: +4940 5228536
"As far as I'm concerned,  if something is so complicated that you can't ex-
 plain it in 10 seconds, then it's probably not worth knowing anyway"- Calvin
