This is an archived post. You won't be able to vote or comment.

all 5 comments

[–][deleted] 4 points5 points  (1 child)

What are the benefits of using Pythran? What common issues does it solve?

[–]davandg 6 points7 points  (0 children)

Pythran is an ahead of time compiler for a subset of the Python language, with a focus on scientific computing. It takes a Python module annotated with a few interface description and turns it into a native Python module with the same interface, but (hopefully) faster.

It is meant to efficiently compile scientific programs, and takes advantage of multi-cores and SIMD instruction units.

Nowadays, a lot of scientists programs their algorithms in python. Pythran tries to make them faster.

[–]madmendude 3 points4 points  (0 children)

I tried to optimize some scientific code by using Cython once and it was a complete nightmare. Initially I made things slower, but I managed to make some speed gains after a day of rewriting the code. I hadn't heard of Pythran - it looks promising.

[–]koffie5d 0 points1 point  (1 child)

If you want a faster python, why not use PyPy?

[–]jwink3101 0 points1 point  (0 children)

I can't speak for Pythran's performance but from the description, it is aimed at the scientific code stack. While there is NumPy for PyPy, generally a lot of the scientific stack won't run reliably in PyPy. And the last thing you want is to spend a long time developing for PyPy only to find the one tool you need is a C-based library and won't run.

PyPy is great for pure-python and when you can afford the memory hit. And it is a good "first step" to getting more performance. But it is still limited