[Ecls-list] Announcement: RDNZL - a .NET bridge for CL

Edi Weitz edi at agharta.de
Thu Dec 16 04:29:05 UTC 2004


On Thu, 16 Dec 2004 12:19:28 +0100, Juan Jose Garcia Ripoll <lisp at arrakis.es> wrote:

> I hear people talk about callbacks all the time, but I am not sure
> what implementation they have in mind. Should it be a pointer to a C
> function? A pointer to a C function plus data?

I think in the end you want a pointer to a C function.  From the C
side it should look and feel like a normal C function.  You also need
a way to tell your C libraries where the function is, something like
this:

  <http://www1.xanalys.com/support/lisp/kbase.nsf/51fe6e1cdfe748a180256639005a2ba9/404d1bad7fe771f3802568c400540b50?OpenDocument>

> I would like to add some sort of standard interface to ECL for doing
> that, because on of the trickiest thing of this business is to
> ensure that the data which is passed to the C world is not garbage
> collected.

Unless I'm missing something that problem must be solved without
callbacks as well.  Even with "normal" C calls you want to be able to
allocate C data from Lisp and don't have it gc'ed while the C side
works with it.  Native threads are another issue but I don't think ECL
deals with them yet.

> Finalization hooks would require minor tweaks to the garbage
> collector code -- mainly because you do not want finalization code
> to be run from within the garbage collector, as the Boehm-Weiser gc
> does. Apart from that, it should be doable.

For a rough first port of RDNZL you might get away without
finalization hooks.  You'll have memory leaks, but hey... :)

Cheers,
Edi.





More information about the ecl-devel mailing list