Hi!
I was wondering whether there's a tutorial / introduction to creating
bindings to C libraries for common lisp. I've never done this sort of
thing before, but I've noticed existing packages I use using uffi and
cffi.
Is this very nonstandard across platforms? I'm using sbcl on debian
unstable at the moment.
Rupert
Rupert Swarbrick <··········@gmail.com> writes:
> Hi!
>
> I was wondering whether there's a tutorial / introduction to creating
> bindings to C libraries for common lisp. I've never done this sort of
> thing before, but I've noticed existing packages I use using uffi and
> cffi.
>
> Is this very nonstandard across platforms? I'm using sbcl on debian
> unstable at the moment.
CFFI and UFFI are portability systems for Common Lisp FFI. CFFI is
newer. CFFI has a tutorial here:
http://common-lisp.net/project/cffi/manual/html_node/Tutorial.html
Zach
On Sun, 09 Dec 2007 08:54:29 -0500, Zach Beane wrote:
> CFFI and UFFI are portability systems for Common Lisp FFI. CFFI is
> newer. CFFI has a tutorial here:
>
> http://common-lisp.net/project/cffi/manual/html_node/Tutorial.html
>
> Zach
Thank you very much for the answers! I should have carried on digging for
another 20 minutes! The cffi docs look much friendlier, so I think I'll
go with that.
Now off to get something working...
Rupert
On Sun, 09 Dec 2007 12:37:55 +0000, Rupert Swarbrick wrote:
> Hi!
>
> I was wondering whether there's a tutorial / introduction to creating
> bindings to C libraries for common lisp. I've never done this sort of
> thing before, but I've noticed existing packages I use using uffi and
> cffi.
>
> Is this very nonstandard across platforms? I'm using sbcl on debian
> unstable at the moment.
Both cffi and uffi are portable across platforms, but I don't think
either of them is portable across _all_ current platforms. See the docs.
I'm using cffi to interface with a few libraries at the moment, and I
think it's pretty easy to use. Uffi looks similar, but I haven't used it
myself. I'd done some C programming and extension building for other
languages before I started on lisp, and I guess that taints my estimate
of how easy cffi is (it is much easier than Perl/XS when you're dealing
with a simple API, for instance. On the other hand, Perl/XS makes it easy
to add glue on the C-side of the interface, while cffi does nothing like
that.
As for the tutorial, did you see this?
http://common-lisp.net/project/cffi/manual/html_node/Tutorial.html
Joost.
Joost Diepenmaat wrote:
> On Sun, 09 Dec 2007 12:37:55 +0000, Rupert Swarbrick wrote:
>
>
>>Hi!
>>
>>I was wondering whether there's a tutorial / introduction to creating
>>bindings to C libraries for common lisp. I've never done this sort of
>>thing before, but I've noticed existing packages I use using uffi and
>>cffi.
>>
>>Is this very nonstandard across platforms? I'm using sbcl on debian
>>unstable at the moment.
>
>
> Both cffi and uffi are portable across platforms, but I don't think
> either of them is portable across _all_ current platforms.
CFFI is, for any reasonable value of _all_.
kt
--
http://www.theoryyalgebra.com/
"In the morning, hear the Way;
in the evening, die content!"
-- Confucius