Automated Wrapper Generation with Clasp

Christian Schafmeister chris.schaf at verizon.net
Wed Jun 24 03:28:38 UTC 2015


Hey Andrew,


(1) So SAL9000 is interested in implementing something like this (automated C++ groveling and FFI building) in Clasp as well and he’s made a lot of progress understanding how to use the Clang ASTMatcher and AST libraries that are exposed within Clasp.  So you guys should talk.

(2) I think you could to a lot better than SWIG on the groveling side given that we have a C++/C/Objective C compiler.  SWIG has had C++ support “under development” for 15 years.

(3) There is no contribution policy for Clasp.  What should it be?  Are there any good models we can copy? If you keep it as a separate project for now then maybe there are no immediate issues.

(4) It’s ready for documentation and the programmers interface to Clasp is not in so much flux.  What’s in flux is the underlying implementation which I’m working very hard on to make faster.  LaTeX is great.

I’m happy to provide support and training to get people up and running but I don’t have an enormous amount of time so doing things with Clasp will require people who are pretty self-sufficient.

Best,

.Chris.


On Jun 19, 2015, at 5:12 PM, Andrew Robin <a_t_robin at yahoo.com> wrote:

> Hello,
> 
> I brought up this subject on #clasp IRC, but thought I would move the discussion to the mailing list.
> 
> [IRC log: http://log.irc.tymoon.eu/freenode/clasp?around=2015-06-19T16:13:25&types=mnaot#1434730405 ]
> 
> I'm looking into wrapping a large C++ library with CL.  The library is an implementation of Open Inventor, coin, which is a C++ scene graph library based on OpenGL.  I think eventually it would be an interesting project to port Open Inventor to CL natively.  However, at present what I want to do is call it from CL.  (For those of you doing chemistry with Clasp, having Open Inventor as a library in Lisp could help integrate the visualization of molecules into your workflow.)
> 
> [Coin: https://en.wikipedia.org/wiki/Coin3D ]
> 
> Currently, Clasp provides a lot of what I need to wrap Open Inventor.  However, I would like to automatically parse (a large number of) C++ header files and generate CL bindings without writing a lot of boilerplate.  I think it would be good idea to support both the native method Clasp uses, as well as standard FFI(s).  As a side effect it would be nice to be able to produce a generic C API from the C++.  The SGI release of Open Inventor had such a C API, and its conventions are documented.  Open Inventor might be good starting point to automate wrapper generation, because the interface uses a limited subset of C++ features, having been written in the '90s.
> 
> I looked into using SWIG ( www.swig.org ), which is a general purpose wrapper for C/C++.  Although I have successfully used it for projects in the past, SWIG is somewhat opaque (to me).  It would be a good source of concrete techniques for this project though. 
> 
> I'm willing to contribute to Clasp to add this capability, but I had a few further questions before I jumped in:
> 
> 1) Should we add this capability to the subproject clbind?  Create a new subproject?
> 
> 2) Should we make the tool modular, so we can add other native bindings?  I don't think we should re-invent SWIG, but you never know.
> 
> 3) Is there a contribution policy for Clasp?  Do you have a copyright assignment form?
> 
> 4) Is the Clasp project ready for some high level documentation or is it in flux?  I am willing to write documentation as I learn the system.  I prefer to do it in LaTex.
> 
> Thanks,
> 
>   (o>
>   (  )   
> --++--Andy
> 
> 
> 




More information about the clasp-devel mailing list