Is there some reason you need to run GHCi as a separate process? By doing so, you constrain yourself to communicating with it using inter-process communication (like pipes). Maybe signals too.. but that becomes jolly tricky when you want to port across platforms.
The obvious alternative is to use GHC as a library. That is the way GHCi currently works: a small interactive loop sitting on top of a big library. Very partial info here http://haskell.org/haskellwiki/GHC/As_a_library I think that'd be a lot easier. If you want to maintain responsiveness of the GUI, when kicking off an evaluation that uses lots of time, you can use Haskell threads. Simon | -----Original Message----- | From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of | [EMAIL PROTECTED] | Sent: 20 November 2006 15:01 | To: [EMAIL PROTECTED] | Subject: communication with ghci from haskell | | Dear experts, | | we are currently developing a GUI for GHCi in Haskell using gtk2hs. We | have encountered a problem concerning the communication with GHCi. In the | current version we run GHCi in the background using the | "runInteractiveProcess" function from the module System.Process. The main | difficulty is that we don't see any possibility to determine when GHCi has | finished its computation and is awaiting user input, that is to say, we | don't know if there are any appropriate signals from GHCi that we could | somehow handle in Haskell. Our program already works as long as we just | execute some "standard" evaluations, but as soon as we do something | "extravagant" like e.g. nonterminating evaluations (say cycle [1,2,3]), or | certain IO-processes we can neither display the output up to the current | point of evaluation nor interrupt the calculation. We hope to have | described our problem precisely enough and would greatly appreciate any | helpful hint. Thanks a lot! | | Greets | | Matthias Stemmler and Bastian Hackler | | University of Marburg, Germany | _______________________________________________ | Cvs-ghc mailing list | [EMAIL PROTECTED] | http://www.haskell.org/mailman/listinfo/cvs-ghc _______________________________________________ Cvs-ghc mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/cvs-ghc