On Wed, 2008-11-26 at 00:20 -0800, Derick Eddington wrote: > On Tue, 2008-11-25 at 21:44 -0800, marcomaggi wrote: > > * inspect the value of constants in C language header files > > and detect the size of data structures in foreign libraries; > > * preprocess .sls files to make available the above values > > at the Scheme level; > > There are already people who have this covered well, using Scheme > macros. Felix Klock has investigated it and written a paper about it > and we discussed it a little here: > > http://groups.google.com/group/ikarus-users/browse_thread/thread/93a5556aef3fa10a > > I think Felix just needs to find the time to port it to R6RS. I'm > semi-planning to port it, if he doesn't have time, once his paper > becomes available and I read it. I think it'll be a portable (probably > using *.IMPL.sls) library we/somebody will integrate with a higher-level > FFI layer that will be what's usually used by others and it'll be as > behind-the-scenes, automated, and convenient as possible (using > expand-time macros that exec GCC test-compile processes to figure things > out), and your build framework will only need to consider it another > normal dependency and check that it's already installed.
I don't mean to discourage you from making your build framework help figure things out for FFI-using libraries, but to encourage you to leverage the work already done. AFAIK, Felix's work was focused on getting struct offsets correct in spite of hidden packing/padding issues introduced by the C compiler, with the future goal of extending his work to help with more FFI things. I'm imagining that Autoconf-reported info should be used to generate libraries (or include files) which will be used by the rest of the Scheme FFI layers. -- : Derick ----------------------------------------------------------------
