#1 support CLISP FFI

Sam Steingold

CLISP (http://clisp.cons.org,
http://sf.net/projects/clisp\) has an FFI.
It should not be too hard to incorporate CLISP support
into SWIG


  • Logged In: YES

    Indeed, it is rather easy to write new language modules.
    But nobody is using CLISP here, so I guess a CLISP user
    should write the CLISP FFI backend for SWIG. Maybe it's you?

    I suggest you start from version 1.3a5 and look at one of
    the smaller language modules (I would suggest starting from
    the Guile module -- it tries to do everything via typemaps,
    rather than hard-coded in the program).

  • David Morse
    David Morse

    Logged In: YES

    I'm interested to help, and tried to have a go at it a few
    months ago. I was more trying for {ACL, CMUCL, CLISP} than
    just {CLISP}. I also mighta been trying with an older SWIG.

    I hit immediately the problem that most trendy-language FFIs
    are written in C, then linked into the interpreter. Most
    lisp FFIs are written solely in lisp, with no C. For my
    level of hacking, SWIG had a achitectural bias towards
    producing C code, that I couldn't weasel around
    productively. Here "productively" means "cost to adapt
    SWIG" > "cost to adapt GCC's C parser".

    This is not to poo-poo the idea. Indeed, I'm infinately
    enthusiastic to work with someone/anyone else on this!
    Gimmie a e-note if you have ideas.

  • Logged In: YES

    From an earlier discussion, I believe to recall that the
    main problem was constant expressions as in #define M_PI
    (3.1 + EPSILON), where one needs one invocation of the C
    compiler in order to compute the value of the expression.

    But this is not a SWIG design issue but simply unavoidable
    if you want to generate an FFI by processing the C header
    files. So we should not worry about it.

    So my suggestion goes like this: Create _two_ lisp files for
    the FFI; one is generated by SWIG directly, the other one is
    generated by running a little C program consisting only of
    printf() calls. (The C program is generated by SWIG again.)

  • William Fulton
    William Fulton

    • status: open --> closed
  • William Fulton
    William Fulton

    Logged In: YES

    CLISP with UFFI added for SWIG-1.3.26