Quoth Alex Queiroz <asand...@gmail.com>,

>      Actually some Scheme compilers have a "c-declare" form that lets
> you create C functions, which can be called from C, Haskell, Java,
> Ruby etc.

That would be like what you get with Haskell FFI "export"?

When I do this with nhc98, I need a nhc98 "main", and I would expect
the same with GHC.  Part of the deal would be smuggling in and
initializing the Haskell runtime.  Also figuring out storage, if
returning any values from the exported Haskell function (as opposed
to poking them into address parameters.)  I can see how this would
not be suitable for a library.

But the same applies to C code generated by "nhc98 -C".  It looks
more like a compiled Haskell module expressed as a C program, than
Haskell translated to C, if that makes sense, and it will certainly
have all the same issues as the Haskell module.

        Donn

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to