FFI

Motivation

It would be worthwhile to make LISP FFI as easy as possible. LISP is great, but for performance-critical apps, you probably need a lower level language like C/++ for it to perform practically. But you can still use LISP for the non-bottle neck parts, of which there will be tons - and writing them in LISP will probably make development a lot more pleasant and efficient. So you need FFI. In other scripting languages like Python, I believe FFI is pretty simple to do (although I have no experience there). But I think LISP's FFI could be a whole lot more newbie-friendly - I still haven't been able to figure it out.
For what it's worth, I don't know that this is the main motivation for FFI in Common Lisp. With good declarations, Common Lisp can run very quickly, and depending on the implementation, FFI may be too costly. For example, I remember reading that one popular unix Common Lisp had to box and unbox all floating point values going to foreign functions. I'm sorry if I am misrepresenting this implementation if they have since improved this. For me, the primary motivation of FFI is to have access to already existing libraries.

Proposed Goals

So those are my ideas so far. Right now, I'm still a n00b so I'm gonna try to get FFI working for myself :) I'm using CMUCL in Redhat. If you've done FFI before, please post tips/instructions here (or start new wiki pages) that everyone can look at. Then eventually we can compile a complete organized FAQ or something. --Steven An (stevenan at gmail dot com)

CFFI has good documentation (still being improved). If you want to contribute, see this message in the gardeners list.

Yardstick

In order to evaluate any of the existing FFI implementations we need some kind of working definition of what an FFI is supposed to allow. Here's a strawman. Please, feel free to amend/correct as appropriate -- verec

Source of ideas

Assuming we can all resist the NIH syndrome :-) -- Not NIH, I'm not familiar with JNI, but at first sight it seems to be similar to Python's or Perl's way of accessing C libraries. It is radically different from an FFI. Can whoever left this last comment, expand a bit. JNI seems to me to be very much like an FFI. (Unless you're talking about the Invocation API part of JNI which is a very different thing.) --Peter Seibel

Team Members

Steven An
quasi

Resources

So far, just some quick newbie Googling:


This page is presently Uncategorized: please add appropriate category markers? and remove this text.

�����


This page is linked from:

Gardeners Projects