[Haskell-beginners] Re: Compiling C into Haskell

Maciej Piechotka uzytkownik2 at gmail.com
Tue Apr 13 10:54:37 EDT 2010


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/beginners/attachments/20100413/0de84e11/attachment.bin


More information about the Beginners mailing list