[Haskell-cafe] Injecting Haskell into C

Bulat Ziganshin bulat.ziganshin at gmail.com
Wed Sep 24 09:42:39 EDT 2008


Hello Roman,

Wednesday, September 24, 2008, 2:04:38 PM, you wrote:

> As I understand, there are two ways to do that. Either Haskell code is
> called from C, or C code is called for Haskell. So my questions are:
> 1. Are they both possible?

yes. "foreign export" exports Haskell functions to C world, foreign
import does opposite

> 2. If yes, which is better performance-wise? (C function is
>    performance-critical). If generated function is called many times,
>    how big an overhead is going to be?

foreign import *unsafe*

-fvia-C together with -O2 may improve speed of C function calls



-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list