[Python-compilers] Wrapping JIT-compiled functions

Siu Kwan Lam siu at continuum.io
Sun Jul 10 16:20:24 EDT 2016


We recently added a similar functionality to Numba.  Via a @cfunc
decorator, we can compile functions at runtime and expose a ctypes function
object for use in other libraries.  We also have an example on using scipy
quad at http://numba.pydata.org/numba-doc/latest/user/cfunc.html.

On Sun, Jul 10, 2016 at 11:22 AM Stefan Behnel <stefan_ml at behnel.de> wrote:

> Mark Dewing schrieb am 10.07.2016 um 07:23:
> > It seems any wrapper around
> > a native code library that uses
> > callbacks will need code to handle a native code callback vs. a Python
> > callback.
> >  For details, see these pull requests:
> >      https://github.com/saullocastro/cubature/pull/16
> >      https://github.com/JohannesBuchner/PyMultiNest/pull/73/files
> >
> > One of the issues in generalizing this is how to scale to different
> > libraries and callbacks without needing to program knowledge of each of
> > them into Sympy.
> > There needs to be some way to describe the parameters expected in the
> > callback, but it should be at a higher level than just C types - which
> ones
> > are inputs, outputs, array lengths, etc.
>
> A couple of years ago, we did some thinking about this in the Cython
> project. Here's the write-up from back then, don't remember how complete it
> is. It never lead anywhere since no-one stepped up to implement that
> protocol.
>
> https://github.com/cython/cython/wiki/enhancements-cep1000
>
> Stefan
>
> _______________________________________________
> Python-compilers mailing list
> Python-compilers at python.org
> https://mail.python.org/mailman/listinfo/python-compilers
>
-- 
Siu Kwan Lam
Software Engineer
Continuum Analytics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-compilers/attachments/20160710/07f43759/attachment.html>


More information about the Python-compilers mailing list