[plt-scheme] Re: image manipulation

From: Eli Barzilay (eli at barzilay.org)
Date: Thu Mar 25 14:43:06 EST 2004

On Mar 25, John Kozak wrote:
> 
> > In fact, what we _really_ need is a nice FFI-builder.  The SRFI-4
> > C code would then presumably be generated automatically from an
> > interface specification.
> 
> there's SWIG...

SWIG is still static, which means that you need to compile stuff.
IMO, a far better approach is a dynamic facility.  The thing I was
talking about can do this -- given the C function:

  int foo_add1(int x) {
    return x+1;
  }

the only thing you need to do in Scheme to interface it (assuming it
is in a .so or a .dll) is:

  (define foo-add1 (get-ffi-obj "foo_add1" "foo.so" '(int -> int)))

The tricky thing is to get this to work with H.O. functions.  (Which I
have, only with the GPL'd code...)

I think this is much more in the Scheme spirit...  (Not to mention
making life better for a certain popular OS that doesn't come with a
compiler.)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.