Hacker News new | past | comments | ask | show | jobs | submit login

Cython is really great at a small scale, but it has issues scaling up to large codebases (of Cython), where I think it's an anti-pattern. None of these are the fault of the Cython creators, it's really an extremely useful tool, it's just inherent in the design space, the things that make it so cool (transparently mix C and Python!) come with trade-offs.

1. Memory unsafety. It's still C or C++ in the end, the more you shift your code in that direction the easier it is to screw up.

2. Two compiler passes: first Cython->C, then C->machine code. This means some errors only get caught in second pass, when it's much harder to match back to the original code. Extra bad when using C++. Perhaps Cython 3 made this better, but it's a very hard problem to solve.

3. Lack of tooling. IDE support, linting, autoformatting... it's all much less extensive than alternatives.

4. Python only. Polars is written in Rust, so you can use it in Rust and Python, and there's work on JavaScript and R bindings. Large Cython code bases are Python only, which makes them less useful.

Long version: https://pythonspeed.com/articles/cython-limitations/




The tooling support isn’t ideal, but there are jump to definition extensions for Cython in vscode.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: