|| ||Robert Bradshaw <robertwb-AT-math.washington.edu>|
|| ||Cython 0.11 Released|
|| ||Sat, 14 Mar 2009 01:17:49 -0700 (PDT)|
|| ||Article, Thread
The Python compiler Cython 0.11 was just released. We would like to
thank Stefan Behnel, Robert Bradshaw, Ondrej Certik, Lisandro
Jason Evans, Magnus Lie Hetland, Hoyt Koepke, and Dag Sverre
Seljebotn who contributed code to this release, as well as the many
others who contributed ideas, bug reports, and feedback.
What is Cython?
Cython is a language that makes writing C extensions for the Python
language as easy as Python itself. Cython is based on the well-known
but supports more cutting edge functionality and optimizations.
The Cython language is very close to the Python language, but Cython
additionally supports calling C functions and declaring C types on
variables and class attributes. This allows the compiler to generate
efficient C code from Cython code.
This makes Cython the ideal language for wrapping for external C
and for fast C modules that speed up the execution of Python code.
Where to get it?
The majority of changes in this version are internal, the largest of
which is moving most temp allocation to the code generation phase
which has several advantages and will greatly facilitate future
development. In conjunction with this, Dag Sverre Seljebotn wrote a
"reference counting nanny" which, when enabled, warns of potential
double-frees and memory-leaks. Though it will not find memory leaks
in user code (malloc is just as dangerous as ever) it is a great
for verifying that Cython itself is outputting correct code and is
invaluable consistency check during the many changes we've been
making to temporary variable handling. There have also been many
improvements for developers--for example, the parse tree is printed
on compiler crashes, the testing framework has been enhanced, and
there is a mode to produce output files interlaced with the
compiler's call stacks to more easily trace what's going on.
The most visible new user-level features are size_t as a native type
(as part of Lisandro Dalcin's cleanup and improvement of Python <->
type conversions) and proper Python semantics for optimized range()
loops (Magnus Lie Hetland). C(p)def functions can now take
decorators, though only @cython.locals is currently supported, and
inline functions can appear in .pxd files. There were also numerious
bug fixes, optimizations, and general code cleanups that happened in
this release too.
A list of closed tickets can be found at http://trac.cython.org/
cython_trac/query?group=component&milestone=0.11 . Though not every
change is associated to a trac ticket, we plan to be more stringent
about this in the future.
We have several patches already done that didn't make it into 0.11,
and so 0.11.1 will be out soon.
Support the Python Software Foundation:
to post comments)