4 ms·
Was surprised to see Cython support on this list. Can somebody elaborate on the relationship between the two? I had always viewed them as alternatives.
by hyperbovine 9y ago
Was surprised to see Cython support on this list. Can somebody elaborate on the relationship between the two? I had always viewed them as alternatives.
- orf 9y agoCython is just a nice way of writing Python C extensions without the boilerplate, which hooks into setuptools and has a more pythonic syntax than C/C++. They are not so much alternatives, rather complimentary things. I guess this release allows Cython compiled modules to work directly with PyPy, which is nice.
- Santosh83 9y agoYou're probably thinking of CPython, which is indeed an alternative to PyPy.
- geofft 9y agoCython is a way of writing compiled code that links against Python in a way that's easier than than using the Python.h API directly. There are two things you can do with this. The first is you can write your performance-sensitive code directly in Cython, in which case, yes, that's a direct competitor to PyPy. (So is writing your performance-sensitive code directly in C and using Python.h to expose it to Python as a native-code module.) The second is that you can write bindings to existing C (or C-ABI-compatible, really) code in Cython, instead of using C and Python.h to write those bindings. In that case, it's not quite that you care about the performance of your C code, but that it already exists, and you just need to call into it somehow. Having PyPy be able to use these existing codebases is valuable.
- syllogism 9y agoThe aim would be to have Cython generating C code that compiles into extensions compatible with PyPy. I'm guessing this is most easily achieved by doing a bit of work on the Cython end, and a little bit of work on the PyPy end.