GHC Api

Ian Lynagh igloo at earth.li
Fri Jan 3 19:34:23 UTC 2014


On Fri, Jan 03, 2014 at 10:19:02AM +0000, Simon Peyton-Jones wrote:
> | Is this with a statically linked or dynamically linked GHC?
> 
> I don't know.  How would I find out?  (It's the one built by validate.)
> 
> You are asking about GHC, but I guess there's also the question of whether the test program itself is statically or dynamically linked.

Oh, yes, sorry, I was thinking this was in ghci for some reason. You're
right that it's the test program we need to know about.

> Why would static/dynamic linking make a difference?  That's very confusing!

With dynamic linking, there will be one shared copy of base, and in
particular one shared stdout buffer. The runtime will flush that buffer
when the program exits. With static linking, you'll be loading a second
copy of base in which the statement is evalauted, and that base will
have a separate stdout buffer. GHCi flushes this when appropriate by
calling flushInterpBuffers.


Thanks
Ian



More information about the ghc-devs mailing list