Re: Runtime importing of modules in GHC

2002-05-27 Thread Alastair Reid
It strikes me that you might want to play with or steal code from the Dynamic library if you're disabling/avoiding normal type-checking in this way. The Dynamic library is a bit limited in what types it can handle, is fairly high overhead if you are coercing a lot and won't catch problems where

Re: Runtime importing of modules in GHC

2002-05-27 Thread Andre Pang
On Mon, May 27, 2002 at 10:57:18AM +0100, Simon Marlow wrote: > > So, is there some wizardry out there which allows using the RTS > > Linker to load up .o modules which are not created with the FFI? > > I've been experimenting with it, and I just get segfaults if > > I try to load the adder_closu

RE: Runtime importing of modules in GHC

2002-05-27 Thread Simon Marlow
> .. and now, my real reason for posting the previous message 8) > > Unfortunately, the big limitation of this is that we're going > through the FFI to get things to work. > > This kinda sucks because that means that the exported functions > have to stick to exporting one of the prim_types (Int

Re: Runtime importing of modules in GHC

2002-05-27 Thread MR K P SCHUPKE
Here's how I did it... load your main program _and_ modules into a linker shell program. Keean. Andre Pang wrote: > On Mon, May 27, 2002 at 04:31:02PM +1000, Andre Pang wrote: > > > The concept: You want to have the equivalent of dlopen(); i.e. be > > able to tell the Haskell runtime syste

Re: Runtime importing of modules in GHC

2002-05-26 Thread Andre Pang
On Mon, May 27, 2002 at 04:31:02PM +1000, Andre Pang wrote: > The concept: You want to have the equivalent of dlopen(); i.e. be > able to tell the Haskell runtime system to import a module and > call functions in that module. As an example, say there's > a function called adder: .. and now, my

Runtime importing of modules in GHC

2002-05-26 Thread Andre Pang
Hi all, Manuel Chakravarty has helped me[1] with getting runtime importing of modules (a.k.a. dynamic loading) working in GHC on Linux. It should work on Windows, too. The concept: You want to have the equivalent of dlopen(); i.e. be able to tell the Haskell runtime system to import a module an