
On Tue, 2010-04-13 at 05:39 -0700, Hein Hundal wrote:
Thanks Allan!
I was hoping the C-Haskell mix would work. I am glad to hear that you have good things to say about it.
Why would you like to compile C to Haskell as opposed to using FFI (Foreign Function Interface) - i.e. calling C from Haskell or Haskell from C?
My main reason for thinking about the C-to-Haskell compiler was to address the question "Say you had a C program. Can you always convert it to Haskell in such a way that the compiled Haskell is not too slow and does not need too much memory?" Supposing that too slow means slower than 1/4 the speed of C and too much memory means twice the memory of C.
I'd say that given optimal Haskell compiler (and possibly in IO) - yes. However we don't have optimal Haskell compiler (neither optimal C compiler BTW) so Haskell program might be slower. Or faster (like with combination of sorting and taking first element).
Do you know the answer to this question?
Cheers, Hein
Regards PS. Could you limit length of line to 72-80 characters? Thank you in advance.