Graham Barr said:
> ...
> So there probably should be an RFC to add iterators to the language and
> be avaliable from perl, not just C. But I have no idea how they
> should look etc.
>
More generally, I wonder whether there should be an RFC on the changes
required to make perl a more friendly environment to numerical programming
(both in terms of speed and elegance)... Or at least close collabaration to
ensure that the end result creates a coherent whole. Some of the issues that
come to mind are:
- Matrix ops
- Support for lazy evaluation
- Compile time expression unrolling (e.g. so that $a = sum(@b*@c+@d) does
just one loop and no memory copy, as would occur with expression templates
in C++)
- Ability to specify infinite lists (e.g. like in Haskell)
- Generic programming (iterators, algorithms, etc, eg. like in the STL)

But I also don't know how this should look, or quite where to start tackling
it from. I suspect PDL provides a lot of useful ideas, but I haven't really
used it enough...

> However, and I am makeing an assumption here, probably the most common
> use of reduce is with one of the + - / * operators. So it would be nice
> to be able to optimize these, maybe to a separate op.

Well, maybe. But don't forget about min and max and everything in between,
which always seem to cause grief for reduce/fold implementations.


Reply via email to