Dan Sugalski wrote:
> I've been thinking that it'd be nice to support extended array/list stuff
> to allow the rudiments of matrix operations into perl:
>
>   @foo = @bar x 3;
>   @foo = @bar * 4;
>   @LoL = @foo * @bar;
>   @baz =~ s/here/there/;
>
This would really fill a gap, if the speed is there. Currently there are
shortcomings with the major approaches to dealing with matrix ops:
- Custom tools (eg Matlab, Mathematica): Have to jump to other more flexible
tools for many parts of most programs. Expensive
- C++ template libraries (eg Blitz++, POOMA): Poorly supported by most
compilers due to complexity of expression templates (leads to compile
failure or very slow execution). _Very_ slow compilation (expression
templates can't be easily explicitly instantiated, either)
- Modern strongly typed langauages (eg. C++ with STL/valarray, Java): Need
to use looping constructs, which does not replicate mathematical language
closely
- FORTRAN: Showing its age. Hard to use complex data types
- Functional languages: Counter-intuitive for those from procedural
backgrounds. Can require deep understanding of underlying implementation to
avoid very slow execution

If Perl borrowed some of the list notation and folding approaches from a
functional language like Haskell, and incorporated some of the tensor
notation approaches from Blitz++ or POOMA, I think the language would be
ideal for numeric programming.

Or, to borrow Tom's phrase, it would make numeric programming fun again.

--
  Jeremy Howard
  [EMAIL PROTECTED]

Reply via email to