[Haskell-cafe] Interfacing with the GHC runtime from a library

Ryan Yates fryguybob at gmail.com
Sat Oct 10 00:19:18 UTC 2015


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 at 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 at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20151009/564eb62b/attachment.html>


More information about the Haskell-Cafe mailing list