Newbie question: using PyPy to compile the source of a single function?
I’m looking for some way of programmatically using PyPy to compile a snippet of python source code (probably a function def) into an optimized binary, which I can call to pass data back and forth. The end goal is to have something like this @PyPy def expensive_function(arg): ... expensive computation ... return result using macros (https://github.com/lihaoyi/macropy) to perform this conversion at import time. I have no idea if this is possible or not; could anyone here give me any pointers or advice how to do this/why it is impossible? Thanks! -Haoyi
Pypy is JIT. if you want to do such thing you better look for Nuitika and Cython. On Sun, May 5, 2013 at 5:02 AM, <haoyi.sg@gmail.com> wrote:
I’m looking for some way of programmatically using PyPy to compile a snippet of python source code (probably a function def) into an optimized binary, which I can call to pass data back and forth. The end goal is to have something like this
@PyPy def expensive_function(arg): ... expensive computation ... return result
using macros (https://github.com/lihaoyi/macropy) to perform this conversion at import time.
I have no idea if this is possible or not; could anyone here give me any pointers or advice how to do this/why it is impossible?
Thanks! -Haoyi
_______________________________________________ pypy-dev mailing list pypy-dev@python.org http://mail.python.org/mailman/listinfo/pypy-dev
participants (2)
-
haoyi.sg@gmail.com
-
Phyo Arkar