dynamic loading with ghc api?

2011-04-07 Thread Rob Nikander
Hi all, I'd like to load a value from a .o file. I've got... import ObjLink main = do initObjLinker loadObj Thing.o resolveObjs Just ptr - lookupSymbol Thing_value_closure Is that the correct symbol to load for the name value in module Thing? And if so, how to I get the haskell value

Re: dynamic loading with ghc api?

2011-04-07 Thread Don Stewart
Perhaps look at the plugins package source? -- Don On Thu, Apr 7, 2011 at 12:20 PM, Rob Nikander rob.nikan...@gmail.com wrote: Hi all, I'd like to load a value from a .o file.  I've got... import ObjLink main = do  initObjLinker  loadObj Thing.o  resolveObjs  Just ptr - lookupSymbol

Re: dynamic loading with ghc api?

2011-04-07 Thread Rob Nikander
Is the 'plugins' package compatible with dynamic linking of the main program? I ask because I wrote a test program using System.Plugins.load and it works fine, but when I link it to the GHC api using `ghc -dynamic ...' (which is nice cause it avoids the 50 MB executable), it seg faults when it

Re: dynamic loading with ghc api?

2011-04-07 Thread Don Stewart
Using plugins with dynamic Haskell objects hasn't been tested in quite a while. -- Don On Thu, Apr 7, 2011 at 5:14 PM, Rob Nikander rob.nikan...@gmail.com wrote: Is the 'plugins' package compatible with dynamic linking of the main program?   I ask because I wrote a test program using