[Matrix-SIG] Re: blitz++ vs. NumPy?
David Ascher
da@skivs.ski.org
Fri, 11 Dec 1998 10:56:41 -0800 (Pacific Standard Time)
> It will be worthwhile only if the following Python expression does
> not generate temporary arrays.
>
> >>> a = a + b + c
>
> But this requires changes to the Python interpreter.
I'm not sure that's true. the __add__ operation could return 'lazy'
wrapper objects around the operation bound w/ references to the operands,
which would get evaluated when the contents of the array are accessed.
Similarly, wrappers around compound operands could be smart and avoid the
need for temporary arrays.
Non-trivial, as math teachers are fond of saying, and sweeping, but
something to think about in a redesign.
--david
PS: For an even more radical approach, see the papers by
Kiczales et al. on open implementation and aspect-oriented
programming, e.g.
http://www.parc.xerox.com/spl/groups/eca/pubs/papers/Kiczales-ECOOP97/for-web.pdf
and the larger collection at
http://www.parc.xerox.com/spl/groups/eca/pubs/