Re: Restrictions Felix Winkelmann 06 Jan 2004 10:57 UTC

Am Tue, 06 Jan 2004 11:37:43 +0100 hat Michael Sperber
<xxxxxx@informatik.uni-tuebingen.de> geschrieben:

>>>>>> "Felix" == Felix Winkelmann <xxxxxx@proxima-mt.de> writes:
>
> Felix> You normally don't cons that much in wrapped code: C doesn't know
> Felix> about Scheme data. It cares about C data.
>
> If that holds, then the current draft doesn't require you to do any GC
> annotations on that code, and most of the problems go away.

Wrong, because the current draft passes around unconverted, live Scheme
data merrily, without worrying about the consequences. Instead give
C data to the C code. It's really not that hard to understand. Look how
the Gambit FFI does it, for example.

> For C code where it doesn't hold, both the current draft and what you
> seem
> to be suggesting cause problems.

Not at all. What problems do you mean? The amount of C code for which
this holds is small and some refactoring (reducing the consing to a few
distinct callbacks) does the trick in most cases. I can only judge
 from experience, I can't prove it, of course.

>
> Sure I don't cons much in wrapped code---but I cons often in the code
> which does the wrapping, which comes down to the same thing.
>

You don't have to do that. Let Scheme or implementation-specific
glue code do that.

cheers,
felix