On Mon, 19 Jun 2017, Armin Rigo wrote:

Answered on 
https://stackoverflow.com/questions/44629893/invoke-rpython-based-functions-from-standard-python-code

I would add to that that in the case that the idea was to take some code out of hot loops, translate it into RPython so that it runs faster, and finally import it into cPython, then (as Armin elaborated) you're missing the point of RPython. However, here are few alternatives to consider:

One go-to solution would be to use Cython which lets you easily blend Python / C up to the point of writing restricted C with Python syntax, and import resulting Cython modules into your program running under cPython.

A more principled solution would be to port your application to PyPy (if any porting would be required at all), and enjoy the JIT, or else dig around trying to figure out why exactly is that you're not getting the speedups you were hoping for, and make PyPy better in the process!

--
Sincerely yours,
Yury V. Zaytsev
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to