Hi Nicola,

You can sort of do this, but as far as I know there are still some missing pieces to getting everything you would want.  I'm in the process of doing this for some STM implementations with some colleagues and what I have so far has a few changes to GHC (teaching the GC about some new heap objects) some cmm code in the library imported as foreign prim's and some C code in the library.  I build this with a cabal file and use the "--extra-include-dirs" flag to pass the path to the "rts/" directory for ghc.  This last bit is the unfortunate part that I imagine once we work out what all we need exposed, we could include in what is installed with GHC.  It might already be there, I'm not sure.

Ryan

On Thu, Oct 8, 2015 at 2:24 PM, Nicola Gigante <nicola.gigante@gmail.com> wrote:
Hi everybody,

suppose to have an Haskell library which is in part implemented in C
for whatever reason. Can the C part talk with the runtime, in particular
the scheduler? In other words, does the runtime expose the functionality
needed to implement, for example, the STM library from outside the GHC
runtime itself?

Thank you,
Nicola
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe