
Dear GHC Developers, I'm using the GHC API to load Haskell modules and extract their syntax tree. I need to generate code where TH is used (by default I do in-memory linking). I've run into some trouble with external interpreter. When -fexternal-interpreter is NOT set, I use Linker.unload to remove bytecode from the global linker before reloading modules. However it is not applicable when external interpreter is used and I could not find corresponding functionality in the GHCi module (where communication with external interpreter is implemented). I've recently created 2 tickets related to this question: https://ghc.haskell.org/trac/ghc/ticket/14576, https://ghc.haskell.org/trac/ghc/ticket/14577 Can someone help me with this problem? Best Regards, Boldizsár Németh

Hi, I believe you are looking for the `Message` GADT in `GHCi.Message` ``` -- ----------------------------------------------------------------------------- -- The RPC protocol between GHC and the interactive server -- | A @Message a@ is a message that returns a value of type @a@. -- These are requests sent from GHC to the server. data Message a where ``` maybe specifically the `UnloadObj` message. Cheers, Moritz
On Dec 15, 2017, at 1:46 PM, Németh Boldizsár
wrote: Dear GHC Developers,
I'm using the GHC API to load Haskell modules and extract their syntax tree. I need to generate code where TH is used (by default I do in-memory linking). I've run into some trouble with external interpreter. When -fexternal-interpreter is NOT set, I use Linker.unload to remove bytecode from the global linker before reloading modules. However it is not applicable when external interpreter is used and I could not find corresponding functionality in the GHCi module (where communication with external interpreter is implemented).
I've recently created 2 tickets related to this question: https://ghc.haskell.org/trac/ghc/ticket/14576, https://ghc.haskell.org/trac/ghc/ticket/14577
Can someone help me with this problem?
Best Regards, Boldizsár Németh
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Hi, Thank you for mentioning. I already found the Message type, but my problem is that UnloadObj can only unload object files, however while using in-memory linking no object files are generated. I did not find any means of printing out the contents of the iserv process. On the other hand Linker.unload lets me specify what to keep and everything else is unloaded. Boldizsár 2017.12.15. 15:04 keltezéssel, Moritz Angermann írta:
Hi,
I believe you are looking for the `Message` GADT in `GHCi.Message`
``` -- ----------------------------------------------------------------------------- -- The RPC protocol between GHC and the interactive server
-- | A @Message a@ is a message that returns a value of type @a@. -- These are requests sent from GHC to the server. data Message a where ``` maybe specifically the `UnloadObj` message.
Cheers, Moritz
On Dec 15, 2017, at 1:46 PM, Németh Boldizsár
wrote: Dear GHC Developers,
I'm using the GHC API to load Haskell modules and extract their syntax tree. I need to generate code where TH is used (by default I do in-memory linking). I've run into some trouble with external interpreter. When -fexternal-interpreter is NOT set, I use Linker.unload to remove bytecode from the global linker before reloading modules. However it is not applicable when external interpreter is used and I could not find corresponding functionality in the GHCi module (where communication with external interpreter is implemented).
I've recently created 2 tickets related to this question: https://ghc.haskell.org/trac/ghc/ticket/14576, https://ghc.haskell.org/trac/ghc/ticket/14577
Can someone help me with this problem?
Best Regards, Boldizsár Németh
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
participants (2)
-
Moritz Angermann
-
Németh Boldizsár