Repeated hs_init()/hs_exit()

John Meacham john at
Tue Jan 28 22:03:12 EST 2003

Just out of curiosity, what would happen if hs_exit were a noop? if it
left haskell initialized? I imagine there would be a space leak if you
expected the rts's heap storage to be reclaimed, but is there any
user-observable state which would cause programs to behave oddly? Just
curious mainly, I don't advocate this as a solution.

On Tue, Jan 28, 2003 at 03:54:10PM -0000, Simon Marlow wrote:
> but what about
>   hs_init(..)
>   hs_exit()
>   hs_init(..)
>   hs_exit()
> That is, should the Haskell system be able to start itself up again
> after shutting down?  It looks like this is desirable from a modularity
> viewpoint: eg. a C program initialises library A which uses Haskell
> internally, then de-initialises library A, then initialises library B
> which also uses Haskell internally.
> Unfortunately, this is going to require quite a bit of extra work in GHC
> to get right, and it looks like I'm going to have to examine a lot of
> code to make sure it is "double-init-safe".  Thoughts?

John Meacham - California Institute of Technology, Alum. - john at

More information about the FFI mailing list