Helmut Eller <[EMAIL PROTECTED]> writes: > Nicolas Neuss <[EMAIL PROTECTED]> writes: > >> Also, I would be interested if there is a automatic >> translation of C header files in CMUCL ffi code (maybe along the lines >> Matlisp works for Fortran routines). > > I have a half finished CMUCL port of OpenMCL's interface generator. > It's not polished and I haven't used it "in anger". Basically it > implements OpenMCL style reader macros to fetch foreign type > information from a type data base at read time. So you can write: > > (#_printf (sys:vector-sap "foo bar %d") (int -234)) > > The #_ reader macros will extract the argument type and the return > type for printf. It also deals with varargs. It also adds a hook to > CMUCL alien parser so that type information for structs and unions can > be looked up in the type data base. The type data base is simply a > big hash table stored in a fasl file created by a modified version of > GCC and slightly post-processed with some lisp code. > > Get the package from: <http:common-lisp.net/~heller/fti.tgz> > > But you have been warned, it's only half finished and it requires some > persistence to get it to work.
I have looked at the code, but I fear that I do not have the necessary persistence. Nevertheless, I think that this project is very important, because easy interfacing with other languages, especially C, will be a crucial point if CL should ever become more popular again. In this direction: couldn't the #_ macro automatically convert strings, fixnums, etc automatically to their C representation? Thanks, Nicolas.
