[cffi-devel] CFFI and SBCL

Luis Oliveira luismbo at gmail.com
Tue Sep 27 12:05:58 UTC 2005


Hello,

On 27/set/2005, at 12:21, Immanuel Litzroth wrote:
> I tried out CFFI on SBCL linux yesterday and would like to give some 
> feedback.
> 1) On SBCL the rt package is named sb-rt.

Hmm, but is it identical to the asdf-installable rt?
   http://www.cliki.net/RT


> 2) The string callback test does not compile nor does the qsort 
> callback test.

You don't mention what SBCL version you are using, but it's probably 
something prior to 0.9.4.11. That's an SBCL bug and if you grab it from 
CVS head or wait a few days for 0.9.5 you'll see it's fixed there.

Except I just added a new callback test and SBCL fails that, heh. I'll 
report it to sbcl's mailing list in a second.


> I also have the following observations.
> * SBCL and CMUCL have alien integer types that can specify a number of 
> bits.
> I have had success in optimizing lisp ffi by restricting values to xx 
> bits
> so they can be immediately translated to fixnums. It seems a shame to 
> lose this possiblity in a cffi.

Hmm, I would assume SBCL/CMUCL translate sb-alien:int and c-call:int to 
a fixnum already but I can't say that I checked. Is my assumption 
incorrect?


> * I often need to allocate foreign objects and put them in a lisp 
> struct. I would then want to run a finalizer if the struct gets 
> garbage collected, to free the allocated memory. A nice interface to 
> the finalizer functionality on different systems would be a great 
> feature for cffi.

Indeed it would, and I already skimmed through the various manuals to 
check out the interfaces for that and noted them down, it's in my TODO 
list. :-)

Thanks,

-- 
Luís Oliveira
http://student.dei.uc.pt/~lmoliv/
Equipa Portuguesa do Translation Project
http://www.iro.umontreal.ca/translation/registry.cgi?team=pt




More information about the cffi-devel mailing list