Automagical C header file bindings?

From: Brandon J. Van Every (try_vanevery_at_mycompanyname_at_yahoo.com)
Date: 03/29/05


Date: Tue, 29 Mar 2005 02:31:40 -0800

Is there any Scheme or Lisp technology that will read a pile of *.h files
and generate the appropriate bindings from C to Scheme or Lisp, without user
intervention? The scope of *.h binding I'm interested in is:

- automagically generate OpenGL bindings
- automagically generate SDL (Simple DirectMedia Layer) bindings
http://www.libsdl.org

At least these are, realistically speaking, the things I'd like to create
Scheme or Lisp bindings for. If you say "bindings for these already exist,"
the idea of automagically generating the binding is still important. For
instance, OpenGL will go to 2.0 this year. SDL also undergoes change.

I have a small experience now with Bigloo Scheme's Cigloo utility. It can
help generate a binding, but it can't just suck in arbitrary *.h files and
produce good output. In fact it appears to be choking on simple things like
#---*/ comments that are split upon a line. Also more complex things; the
point is, it's potentially useful, but not automagical. Thought I'd ask if
there's anything automagical or nearly so.

I suppose there's SWIG but I'm wondering if there's anything else. In
particular, something that is only interested in Scheme <--> C or Lisp <-->
C, and thereby has a simpler, more robust, or more automagical
implementation than SWIG.

-- 
Cheers,                     www.indiegamedesign.com
Brandon Van Every           Seattle, WA
"The pioneer is the one with the arrows in his back."
                          - anonymous entrepreneur


Relevant Pages

  • Re: Global variables done right
    ... design of Common Lisp. ... code that creates lexical bindings for X.  It is, of course, still ... all global variables should have named that are bookended by asterisks. ...
    (comp.lang.lisp)
  • Re: Lisp newbie tips
    ... > article that will teach me about working in a Lisp environment? ... debugging you mean first you write this very large program, ... basically have to use dynamic bindings instead. ... that's rather harder to fake by dynamic bindings, ...
    (comp.lang.lisp)
  • Re: Common Lisp Application Builder news
    ... versions of SDL as they are released. ... compared to thick bindings. ... Inadequate because most API's reflect C idioms, whereas Lisp idioms ... rather than cffi-callable POSIX functions (or ...
    (comp.lang.lisp)
  • Re: Making Lisp popular - can it be done?
    ... You ditch Lisp in favor of a language with mature libraries, ... against various GL bindings, such as PyGL: ... You almost certainly will if you try to use immature bindings like most Lisp ... The Posix function glob makes a nice example, ...
    (comp.lang.lisp)
  • Re: Lisp backend protocol
    ... There are also standard bindings for C, java, etc. I've ... being able to drive Lisp server processes from the Unix command line ... Allegro and LispWorks both ... have industrial strength implementations. ...
    (comp.lang.lisp)