[Pyrex] pyrex "versus?" cython

Stefan Behnel stefan_ml at behnel.de
Fri Nov 23 13:50:41 CET 2007


Hi,

David McNab wrote:
> I'm wondering what actual roadblocks might be presently barring the
> ultimate merging of Pyrex and Cython, and if there's any way these
> barriers might be surmounted or dissolved.
> 
> Are the barriers based on technical direction? Differing goals?

Somewhat. Cython is much more open to extensions than Pyrex. Greg usually says
that he's still "designing" Pyrex as a language, so he will sometimes reject
patches for design reasons that solve practical problems in a practical way,
and that therefore find (or found) their way into Cython. Eventually, these
features might still make it into Pyrex in one way or another, but that
usually means that Greg refactors or rewrites them his own way, which implies
that he first has to find the time to do so.

So Cython can afford to be more agile and advanced, but not always mainline
with respect to future Pyrex versions. It usually follows in compatibility
once Pyrex implements a comparable feature, though.

To you as a user this means that if you use Cython today, you can write your
code a lot cleaner and simpler now as you can rely on Cython to optimise it
for you in a lot of ways that you do not have to care about. But if you use
Cython specific syntax features, you may have to do minor syntactic code
changes in the near or far future if you want to go back to a future Pyrex
version or want to support a future Cython version that followed a syntactic
change made in Pyrex.

BTW, Cython now follows a 4-digit versioning scheme that keeps the
corresponding Pyrex version in the first three digits. So you can see it
immediately when it incorporates the changes of a new Pyrex version.

I hope this makes the relationship of both compilers a bit clearer.

Stefan




More information about the Pyrex mailing list