From: Jacob West
Subject: Clisp FFI + ASDF example?
Date: 
Message-ID: <1115016514.954898.200810@f14g2000cwb.googlegroups.com>
Can anyone provide even a very simple example of an asdf system
definition that correctly compiles/loads a C file interfaced through
Clisp's FFI?

Reading though the various scattered bits of documentation that exist
and any potentially relevant source files I can find, I have yet to see
anything that does this.  Surely, it's possible, but I can't seem to
manage it with the clumsy clisp-link script and module mechanism.

Assuming that I would like to stick with Clisp, what are my options?
How do you work with systems that involve lisp and C code in your
projects?

From: Sam Steingold
Subject: Re: Clisp FFI + ASDF example?
Date: 
Message-ID: <ud5s966g0.fsf@gnu.org>
> * Jacob West <··········@tznvy.pbz> [2005-05-01 23:48:34 -0700]:
>
> Reading though the various scattered bits of documentation that exist
> and any potentially relevant source files I can find, I have yet to
> see anything that does this.  Surely, it's possible, but I can't seem
> to manage it with the clumsy clisp-link script and module mechanism.

ASDF is a portable system construction facility.
CLISP modules (and the clisp-link script which, BTW, I have never
invoked by hand - the standard makefile does it for me) is a
clisp-specific facility. why would you want to mix them?

> Assuming that I would like to stick with Clisp, what are my options?
> How do you work with systems that involve lisp and C code in your
> projects?

if you specify the :LIBRARY option to your DEF-CALL-OUT &c forms, no .c
files are created and you just compile and load them like you do any
other common lisp file.

<http://www.podval.org/~sds/clisp/impnotes/dffi.html#def-call-out>

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.palestinefacts.org/> <http://www.iris.org.il> <http://ffii.org/>
<http://www.memri.org/> <http://pmw.org.il/> <http://www.camera.org>
Perl: all stupidities of UNIX in one.
From: Joerg Hoehle
Subject: Re: Clisp FFI + ASDF example?
Date: 
Message-ID: <u8y2xpv9o.fsf@users.sourceforge.net>
"Jacob West" <··········@gmail.com> writes:
> Can anyone provide even a very simple example of an asdf system
> definition that correctly compiles/loads a C file interfaced through
> Clisp's FFI?
> 
> Reading though the various scattered bits of documentation that exist
> and any potentially relevant source files I can find, I have yet to see
> anything that does this.  Surely, it's possible, but I can't seem to
> manage it with the clumsy clisp-link script and module mechanism.
> 
> Assuming that I would like to stick with Clisp, what are my options?
> How do you work with systems that involve lisp and C code in your
> projects?

Please blame the authors of ASDF for their poorly documented piece of
software as well as the early adopters of ASDF as another system
definition facility for using and spreading it instead of other,
better documented and as well working defsystem utilities.

As far as concrete examples, something that comes to my mind is
CL-SQL. It contains a dozen asdf definitions, some of them involving
compiling and loading C code. You could peek at that.
The next step would then involve looking up ext:run-program or
whatever the "run a shell command" utility is called in Clisp.

One difference I see is however: these examples from cl-sql compile C
code and load objects into the runnign Lisp image. While possible with
Clisp (dynamic loading of external modules is present on some
platforms and using of shared libraries is available for nearly all
platforms where Clisp compiles), when using clisp-link you typically
create a new image in which you use the C code, and stop using the
image you started with.

Thus I see two possibilities: either use modules or load a shared
object/dll file. You may wish to investigate both way and see which
you prefer.

Regards,
	Jorg Hohle
Telekom/T-Systems Technology Center
From: Pascal Bourguignon
Subject: Re: Clisp FFI + ASDF example?
Date: 
Message-ID: <87wtqhd1qd.fsf@thalassa.informatimago.com>
Joerg Hoehle <······@users.sourceforge.net> writes:

> "Jacob West" <··········@gmail.com> writes:
>> Can anyone provide even a very simple example of an asdf system
>> definition that correctly compiles/loads a C file interfaced through
>> Clisp's FFI?
>> [...]
>
> Please blame the authors of ASDF for their poorly documented piece of
> software as well as the early adopters of ASDF as another system
> definition facility for using and spreading it instead of other,
> better documented and as well working defsystem utilities.
> [...]

I think the documentation has been improved:

http://constantly.at/lisp/asdf/

http://constantly.at/lisp/asdf/Creating-new-component-types.html#Creating%20new%20component%20types


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

This is a signature virus.  Add me to your signature and help me to live