CFFI: Was ( Question on augmented_lagrangian_method)



I routinely link from Allegro Common Lisp to other programs, e.g. MPFR and
NTL, and QD (quad-double floats).
I use Allegro's own foreign function interface. I have not studied CFFI.  

I might also mention that using Allegro's FFI in the most na?ve fashion may
make the linkage much more expensive than necessary (with copying of stuff
etc.)  while using it properly can make it extremely fast, even making sense
for a subroutine with a relatively small number of operations.

I found that there was one touchy issue about who controls the status of
machine flags (e.g. signalling exceptions) in using the quad-double
arithmetic, so I had to add an extra interface call in that package.
RJF


> -----Original Message-----
> From: maxima-bounces at math.utexas.edu 
> [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Kostas Oikonomou
> Sent: Sunday, May 20, 2007 6:03 AM
> To: Michel Van den Bergh
> Cc: maxima at math.utexas.edu
> Subject: Re: [Maxima] CFFI: Was ( Question on 
> augmented_lagrangian_method)
> 
> I agree with Michel that the  "using external libraries" 
> issue is very important, frustrating, and, if
> properly addressed, would greatly enhance Maxima.
> 
> 				Kostas
> 
> Michel Van den Bergh wrote:
> >>
> >> There are doubtless much stronger methods. About ipopt,
> >> that could be used via a foreign-function interface. I believe
> >> the project called CFFI is the most widely supported of such
> >> interfaces. CFFI doesn't work with GCL, unfortunately. But
> >> maybe it is not too early for Maxima to start working on
> >> libraries in C/C++ and/or Fortran via CFFI for other Lisps.
> >>
> > <rant>
> > This is one of the most frustrating things in maxima. There are so
> > many excellent free software libraries around but they are very 
> > difficult to use
> > in maxima since GCL does not support a decent foreign function
> > interface. As a result the wheel has to be reinvented all the time.
> > Sage for example does not have this problem.
> > Python is trivial to interface with libraries and hence 
> sage can pick and
> > choose the best available implementations for specific functionality
> > (the object oriented nature of python makes this very natural). 
> > So sage has very fast linear algebra over finite fields 
> using linbox, 
> > very fast
> > polynomial arithmetic using the new libSingular etc...
> > 
> > Personally I would simply drop support for GCL if the 
> developers want to 
> > stay
> > in their own little world and not support something 
> **vital** like CFFI. 
> > The possible drop in speed
> > would be more than offset by the possibility of using 
> external optimized 
> > libraries for
> > specific tasks.
> > </rant>
> > 
> > Michel
> > _______________________________________________
> > Maxima mailing list
> > Maxima at math.utexas.edu
> > http://www.math.utexas.edu/mailman/listinfo/maxima
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>