[Numpy-discussion] Cython numerical syntax revisited

Dag Sverre Seljebotn dagss@student.matnat.uio...
Thu Mar 5 01:44:29 CST 2009

Stéfan van der Walt wrote:
> Hi Dag
> 2009/3/5 Dag Sverre Seljebotn <dagss@student.matnat.uio.no>:
>> More details: http://wiki.cython.org/enhancements/buffersyntax
> Interesting proposal!  Am I correct in thinking that you'd have to
> re-implement a lot of NumPy yourself to get this working?  Or are you
> planning to build on NumPy + C-API?

First off, the proposal now is simply to change the syntax for existing 
features, which would simply disable arithmetic and slicing this time 
around. Slicing could perhaps happen over summer, but aritmetic would 
likely not happen for some time. The only point now is that before the 
syntax and work habit is *too* fixed, one could leave the road more open 
for it.

But yes, to implement that one would need to reimplement parts of NumPy 
to get it working. But because code would be generated specifically for 
the situation inline, I think it would be more like reimplementing 
Numexpr than reimplementing NumPy. I think one could simply invoke 
Numexpr as a first implementation (and make it an optional Cython plugin).

The fact that any performance improvements cannot be done incrementally 
and transparently though is certainly speaking against the syntax/semantics.

Dag Sverre

More information about the Numpy-discussion mailing list