On Nov 4, 10:01 am, Konrad Hinsen <[EMAIL PROTECTED]> wrote: > On the other hand, I am not sure that all important algorithms > already have purely functional equivalents that are sufficiently > efficient for real life. Is there an efficient purely functional > algorithm for matrix inversion, for example?
Short answer: No ;-) Long answer: SISAL is an example of a functional parallel language designed for performance. Its compiler could optimize away temporaries in purely functional code (the equivalent of loop/recur). Optimizing away temporaries (esp. temp vectors and submatrices turns out to be important for several reasons: * Parallel GC is scary (not impossible, though) * Memory usage is tight for big problems * A lot of HPC code is limited by memory bandwidth so creating temporary vectors (for example) rather than overwriting existing ones is slow One could express solving linear systems (which is what I presume you mean by "matrix inversion," unless you really want the entries of the inverse) in a purely functional way using a language like SISAL with a compiler that optimizes away temporaries, and the resulting implementation may very well be highly efficient. Krylov methods like conjugate gradient for sparse linear systems would be even easier for the compiler to optimize since they don't modify the matrix, only vectors. HPC coders tend to resist functional implementations because * they like to control memory allocation themselves * the existing code infrastructure is not functional * for cultural reasons That was basically why SISAL didn't take off at Livermore. HPC coders do, however, write a lot of control code, scripts, etc. that can benefit from FP. This is why I follow Clojure (for example). mfh --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---