A colleague of mine pointed out that ghc wasn't performing as he
expected when optimising some code. I wonder if anyone could offer
any insight as to why its not noting this common subexpression:
main = print $ newton 4 24
newton a 0 = a
newton a n = ((newton a (n-1))^2 + a)/(2*(newton a
A colleague of mine pointed out that ghc wasn't performing as he
expected when optimising some code. I wonder if anyone could offer
any insight as to why its not noting this common subexpression:
GHC performs almost no common subexpression elimination, the reasons being
that it can
the loading function - obviously I
can give it a CString for the library, and another for the function in
question - but what would the return type be?
regards,
Richard Warburton
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org
Problem: I don't understand how I can generate the foreign import
statements at runtime.
there are special C libraries that doest it. one of them is libffi,
another one (can't recall its name) is used by ghc itself. libffi
isn't x64-compatible, unlike second one
Thanks a lot. Though the