[Python-ideas] Add specialized bytecode with guards to functions

Guido van Rossum guido at python.org
Wed Oct 21 18:59:50 CEST 2015


On Wed, Oct 21, 2015 at 9:50 AM, Victor Stinner <victor.stinner at gmail.com>
wrote:

> 2015-10-21 18:20 GMT+02:00 Guido van Rossum <guido at python.org>:
> >  I haven't tried the prototype yet, but I wonder if this mightn't be a
> > useful addition to an existing optimizing Python system, e.g. PyPy or
> (plug
> > :-) Pyston?
>
> I'm not sure that specialized functions with guards would benefit to
> JIT compilers.
>

Pyston is not primarily a JIT compiler (at least that's my understanding).

And my point was the opposite: Pyston (or PyPy, less sure) might benefit
from your idea.


> A best match is with Cython, pythran and other projects generating a
> specialized version of a function (in native code), maybe releasing
> the GIL. It would be cool to be able to use a specialized version
> under some conditions. For example, if parameters are all floats, use
> the specialized version optimized by Cython, other fallback to the
> (slow) regular bytecode. The challenge is to automate everything and
> make it easy to use.
>
> I don't know if Numba would match with this design.
>

Admittedly these are also very attractive-looking pairings!

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20151021/40fbe246/attachment.html>


More information about the Python-ideas mailing list