[Haskell-cafe] GHC RTS question

Lennart Augustsson lennart at augustsson.net
Sun Feb 21 18:55:30 EST 2010


Supply a fix for the problem, and it will probably get included.
There has probably been little demand for this feature so far.

  -- Lennart

On Sun, Feb 21, 2010 at 10:21 PM, Ben Millwood <haskell at benmachine.co.uk> wrote:
> On Sun, Feb 21, 2010 at 7:10 PM, Max Bolingbroke
> <batterseapower at hotmail.com> wrote:
>>
>> You might be able to get somewhere by writing a custom "main" function
>> in C and linking it in. According to
>> http://haskell.org/ghc/docs/latest/html/users_guide/options-phases.html
>> if a lib specified with the -l option during compilation contains a
>> "main", that will be used in preference to the one from HSrts.
>>
>
> I think the neater way of doing this would be to use the FFI, with a
> foreign export declaration making your haskell main available to a
> wrapper C file, which would then initialise the RTS with a
> slightly-modified argc and argv.
> See http://www.haskell.org/ghc/docs/latest/html/users_guide/ffi-ghc.html
> for details on how to do that.
>
> I also think it's strange, though, that adding RTS hooks is not
> optional. GHC should support some method of disabling them, in my
> opinion.
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>


More information about the Haskell-Cafe mailing list