[Haskell-cafe] compilation to C, not via-C

Bulat Ziganshin bulat.ziganshin at gmail.com
Fri Apr 24 12:53:05 EDT 2009

Hello Sam,

Friday, April 24, 2009, 8:36:50 PM, you wrote:

> I work in Games middleware, and am very interested in looking at how
> Haskell could help us. We basically sell C++ libraries. I would like to
> be able to write some areas of our libraries in Haskell, compile the
> Haskell to C and incorporate that code into a C++ library. 

well, you can intercept these files. once i wrote simple 4-line
haskell utility (it may be 20 lines of C++ or so) and compiled it down
to C. results was 300 lines or so which it's impossible to understand

so, if you just need haskell-C++ interaction, you may look into using
FFI [1,2]. if you believe that you can compile some
java/ruby/haskellwhatever code down to C++ and incorporate it into
your function - sorry, they all have too different computing model

btw, my own program [3] goes this way - i combine fast C++ and complex
Haskell code via FFI/dll to produce fast, feature-rich application

[1] http://www.haskell.org/haskellwiki/GHC/Using_the_FFI
[2] http://www.haskell.org/haskellwiki/FFI_cook_book
[3] http://freearc.org

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

More information about the Haskell-Cafe mailing list