Question

I'm currently learning to wrap C++ code in Lisp so I can call C++ functions from Lisp. I'm learning about SWIG and I would like to know more about the Allegro Common Lisp part of SWIG. I'm using the Express(free) addition of Allegro now and it has a heap limit of like 50mb so it stops me from loading the GNU Scientific Library for Lisp, GSLL.

I'd like to make a huge App which would be using code from GSLL, Lisp wrappers for OpenCV I create with SWIG and other Lisp wrappers for C++ code I create with SWIG, and I'd like to be able to use all of OpenCV's C++ Interface functions from Lisp and SWIG's Allegro Common Lisp C++ support seems the most complete (and correct me if I'm wrong) and best way to wrap the most C++ functions. (I say this because the Allegro Common Lisp section of the SWIG manual much larger than the Common Lisp sections.

I create OpenCV C++ bindings for Lisp in Allegro Common Lisp Express edition and somehow move them over to SBCL or CLISP so I can use all my GSLL code with my OpenCV wrappers in Lisp implementations that don't have a heap limit or does the Allegro/SWIG partnership deem I only use SWIG C++ wrappers made in Allegro with the SWIG Allegro tutorial in Allegro Common Lisp.

Please correct me if I'm wrong in assuming the Allegro Common Lisp's support is more complete than the other implementations', or if there is a better way to wrap all of OpenCV's C++ functions or if OpenCV's C interface is just as complete as the C++ interface and I can just wrap that.

Please cite online resources when pertinent.

No correct solution

OTHER TIPS

SWIG targeted for AllegroCL will generate wrappers specific to Allegro's proprietary FFI and will not be usable on other lisp implementations. Otherwise, SWIG for common-lisp can generate wrappers targeted to CFFI, which serves as a compatibility layer for all of the foreign interfaces of lisps that it supports. As such, however, CFFI tends to be something of a "least common denominator" among supported lisps and likely the SWIG generation will not be as comprehensive.

My understanding is that there is not much that can be done to interoperate fully between C++ and Common-Lisp. I'm aware of some experimental branches of ECL which sought to do so which claimed some degree of success, but I do not believe these reached the point of public release. At the very least, if you were to go that route, you'd be running on a lisp platform with very, very limited support.

There is another option you may wish to look into for generation of C wrappers that may give more comprehensive results, but that targets CLANG and LLVM compiler environment. If that is acceptable, you can have a look on github at the following two projects:

I'm sure I haven't given the answer you may have been wishing for, but I hope it can be of at least some help.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top