[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] A more detailed plea for help with FFI...

From: Ed Watkeys
Subject: Re: [Chicken-users] A more detailed plea for help with FFI...
Date: Wed, 15 Dec 2004 08:11:13 -0500

On Dec 15, 2004, at 3:28 AM, Joel Reymont wrote:

Ed Watkeys wrote:

This is something, suprisingly, has been far easier to deal with in
Gambit than in Chicken. In Gambit (4.0b11), I can do something like

Ed, ever considered SWIG?

I have had nothing but success with it in trying to wrap RakNet, GuiChan and SDL ;-). Some fixes had to be made to SWIG itself but John Lenz (the
Chicken module maintainer) has been fantastic in his support.

Ideally, I would like to be able to use SWIG, but consider the following from the SWIG documentation:

17.8 Unsupported features and known problems
        *       No exception handling.
        *       No director support.
        *       No support for c++ standard types like std::vector.
* No support for automatic garbage collection of wrapped classes and structures. (Planned on adding in SWIG version 1.3.25)
* Importing multiple SWIG modules not working with TinyCLOS. (Planned on fixing for 1.3.25) * Problems with complicated function overloading. (Planned on fixing for 1.3.25)

This is not acceptable to me: I do not want resource management to be the responsibility of my users i.e. Scheme programmers. I don't know when 1.3.25 is coming out and if these fixes are still planned to be in it. That said, I'm going to play with SWIG a bit and see how well it works.

For what I'm working on -- a wrapper for Core Graphics under OS X, it would definitely be nice to be to be able to use the same code to general libraries for Python, Perl, Tcl, Scheme, etc.

(I know, there's already a wrapper for Python, but Apple hasn't released the module definition. And I'd like an interface that is pretty much an exact translation of the Core Graphics API, so I can read Apple's documentation, mentally translate "CGBitmapContextAddLines" to "cg-bitmap-context:add-lines" and write working Scheme code. Apple's Core Graphics library for Python is different -- and incomplete -- enough to drive you crazy looking for functions that may or may not exist.)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]