"Dan Piponi" <[EMAIL PROTECTED]> writes: > My wasn't intended to represent the problem that I'm trying to solve, > but the approach I want to take. The problems that I do want to solve > don't lend themselves to this kind of approach. > > My real situation is that I want to write code that has both a > high-level component and a low-level number-crunching component that > works on large dense and sparse arrays. Idiomatic Haskell is great for > the high-level component. But the question is whether or not its worth > trying to write the low-level code in Haskell or whether I should just > write that code in C and use the FFI.
I've written a bit number-crunching code in haskell. My experience is that usually the haskell code runs about 2 to 5 times slower -- It depends on whether I use the best optimisation scheme or not -- I do not know if I am doing the correct thing most of the time, since there is not much literature on-line about numerical computing in haskell, or in FP in general. There is one in ocaml, though. > There are still advantages to using Haskell even if the > code is highly unidiomatic: you have the freedom of > throwing in higher order functions from time to time in > the low-level code, and writing mixed-language code is a > pain. -- Dan I fully agree. Xiao-Yong -- c/* __o/* <\ * (__ */\ < _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe