3 ms·
Yea they mentioned alternatives, but cython wasn't mentioned at all. I guess Rust makes sure there aren't any memory issues , but it's far from the only easy op
by 0xCMP 10y ago
Yea they mentioned alternatives, but cython wasn't mentioned at all. I guess Rust makes sure there aren't any memory issues , but it's far from the only easy option.
Cython is used everywhere and can be compiled on the machine it's about to be used on. It also follows best practices for talking to python via FFI.
- ngoldbaum 10y agoNot sure what you mean about cython and the FFI. As far as I know, cython is tightly coupled to the CPython C API. I agree that cython is a good option if you only care about CPython.
- 0xCMP 10y agoThat's true, it does have to be using the C API. I think I just meant there are several ways to use that API and it does the "harder way" automatically so it's more efficient.
- thesmallestcat 10y agoThat's just not true, Cython works with PyPy https://cython.readthedocs.io/en/latest/src/userguide/pypy.html https://cython.readthedocs.io/en/latest/src/userguide/pypy.h..., and it's not like you're going to target Jython with CFFI.
- ngoldbaum 10y agoCython does work with pypy, but via the cpyext emulation of the CPython C API. See this answer from one of the pypy devs when I asked about this about a year ago: https://news.ycombinator.com/item?id=10195892 https://news.ycombinator.com/item?id=10195892 Maybe cpyext has gotten faster since then, but I think that's the state of things still.