TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Cython 3.0 Released

221 pointsby ngoldbaumalmost 2 years ago

11 comments

earthnailalmost 2 years ago
Amazing to read that most comments here are about broken build dependencies. I completely get the frustration, but somewhat sad to see that there&#x27;s not that much talk about the actual improvements.<p>There seem to be a lot of cool things in this. For example, semantics for division, power operator, print, classes, types and subscripting are now identical with Python 3. <a href="https:&#x2F;&#x2F;cython.readthedocs.io&#x2F;en&#x2F;latest&#x2F;src&#x2F;changes.html#improved-fidelity-to-python-semantics" rel="nofollow noreferrer">https:&#x2F;&#x2F;cython.readthedocs.io&#x2F;en&#x2F;latest&#x2F;src&#x2F;changes.html#imp...</a><p>Improved interaction with numpy by moving that part of the code into numpy itself: <a href="https:&#x2F;&#x2F;cython.readthedocs.io&#x2F;en&#x2F;latest&#x2F;src&#x2F;changes.html#interaction-with-numpy" rel="nofollow noreferrer">https:&#x2F;&#x2F;cython.readthedocs.io&#x2F;en&#x2F;latest&#x2F;src&#x2F;changes.html#int...</a><p>Improved support for const and volatile in C, and improved support for C++ expressions like std::move <a href="https:&#x2F;&#x2F;cython.readthedocs.io&#x2F;en&#x2F;latest&#x2F;src&#x2F;changes.html#id6" rel="nofollow noreferrer">https:&#x2F;&#x2F;cython.readthedocs.io&#x2F;en&#x2F;latest&#x2F;src&#x2F;changes.html#id6</a><p>I love how the changelog also shows the bugfixes and improvements that each of these changes enabled. Hats off to the team behind this release.
mturkalmost 2 years ago
A project I work on is currently working through a bunch of performance issues that arose because we had inlined functions in `pxd` files that we did not declare `noexcept nogil`. So, heads up if you see similar regressions! We saw a ridiculous slowdown (7s to 100m, for one suite) because they were inside some awfully tight loops. But the fix was pretty straightforward once we worked it out.
评论 #36780508 未加载
navelsalmost 2 years ago
And chaos ensued. Unable to install aws-cli via pip: <a href="https:&#x2F;&#x2F;github.com&#x2F;aws&#x2F;aws-cli&#x2F;issues&#x2F;8036">https:&#x2F;&#x2F;github.com&#x2F;aws&#x2F;aws-cli&#x2F;issues&#x2F;8036</a>
评论 #36779313 未加载
评论 #36779702 未加载
评论 #36782315 未加载
Waterluvianalmost 2 years ago
The release of this pretty much hosed my morning at work. Suddenly CI wouldn’t build because this broke things in pyyaml and awscli.<p>And then I got to re-learn how very bad Poetry and python dependency management is. I’m trying to update pyyaml to 6.0.1 and Poetry systematically downloaded every single major, minor, patch version of another dependency in trying to find which would fit the version constraints. Took half an hour.
评论 #36783150 未加载
评论 #36780283 未加载
评论 #36783222 未加载
评论 #36783343 未加载
评论 #36783235 未加载
ggmalmost 2 years ago
I get that if I adorn my python3 with types the right way, cython can uplift C betterer, but if I don&#x27;t adorn my python3 and only use core imports (no pip) do I get any benefit?<p>I have some humongous (for me) dict lookups I am doing on strings, counting in ints, and if I could 2x or 3x faster without having to recode I&#x27;d love it. The Cython web is directed at people willing to recode, I am ultimately willing but I wish there was some low hanging fruit evidence: is this even plausibly going to get faster or is dict() walk cost just &quot;it is what it is&quot; ?<p>Oddly, it looks like across pickle dump&#x2F;load I get some improvement. Does pickle restoring consume less memory than raw-made?
评论 #36781582 未加载
评论 #36782849 未加载
评论 #36784380 未加载
评论 #36782851 未加载
westurneralmost 2 years ago
From <a href="https:&#x2F;&#x2F;cython.readthedocs.io&#x2F;en&#x2F;latest&#x2F;src&#x2F;changes.html#compatibility-with-python" rel="nofollow noreferrer">https:&#x2F;&#x2F;cython.readthedocs.io&#x2F;en&#x2F;latest&#x2F;src&#x2F;changes.html#com...</a> :<p>&gt; <i>Since Cython 3.0.0 started development, CPython 3.8-3.11 were released. All these are supported in Cython, including experimental support for the in-development CPython 3.12</i>
bippingchipalmost 2 years ago
This is a somewhat tangential question to the new release, but there might be folks here that can answer this question.<p>Having used swig to create Python bindings for C++ code over 10 years ago, what’s the recommended way to do this in 2023? There’s still swig, there’s Cython, pybind11 and a few others. I do know swig and how complicated it can get with footguns abound when things grow more complex.<p>Is Cython the way to go? How does it hold up to the alternatives? Google search gives many articles on the topic, but many typical SEO optimized low-value, and those that do show a bit of depth, focus on the basic mechanics, not really on things hold up for larger projects…
评论 #36783651 未加载
评论 #36783319 未加载
评论 #36783647 未加载
评论 #36783263 未加载
itamarstalmost 2 years ago
Cython is really great at a small scale, but it has issues scaling up to large codebases (of Cython), where I think it&#x27;s an anti-pattern. None of these are the fault of the Cython creators, it&#x27;s really an extremely useful tool, it&#x27;s just inherent in the design space, the things that make it so cool (transparently mix C and Python!) come with trade-offs.<p>1. Memory unsafety. It&#x27;s still C or C++ in the end, the more you shift your code in that direction the easier it is to screw up.<p>2. Two compiler passes: first Cython-&gt;C, then C-&gt;machine code. This means some errors only get caught in second pass, when it&#x27;s much harder to match back to the original code. Extra bad when using C++. Perhaps Cython 3 made this better, but it&#x27;s a very hard problem to solve.<p>3. Lack of tooling. IDE support, linting, autoformatting... it&#x27;s all much less extensive than alternatives.<p>4. Python only. Polars is written in Rust, so you can use it in Rust and Python, and there&#x27;s work on JavaScript and R bindings. Large Cython code bases are Python only, which makes them less useful.<p>Long version: <a href="https:&#x2F;&#x2F;pythonspeed.com&#x2F;articles&#x2F;cython-limitations&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;pythonspeed.com&#x2F;articles&#x2F;cython-limitations&#x2F;</a>
评论 #36786843 未加载
zapsalmost 2 years ago
Comments confirmed—Python packaging is broken
ilaynalmost 2 years ago
This is probably one of the most anticipated release in the one recent times for all python ecosystem. A sincere thanks to handful (literally) of people who made this possible and despite all kinds of funding challenges.<p>Nevermind the foo broke bar comments here.
gigatexalalmost 2 years ago
This broke a lot of stuff for us at work today. Building the wheels or something I can’t remember. The fix was forcing pip to use not the 3.x and use something older I think.
评论 #36782354 未加载
评论 #36780514 未加载
评论 #36781628 未加载