
I'd suggest #2. It's exactly the reason that GHC is available as a library, and it makes your work much more independent of GHC. If you find it doesn't have the API you need, we can work to improve it. Simon | -----Original Message----- | From: haskell-cafe-bounces@haskell.org [mailto:haskell-cafe-bounces@haskell.org] On Behalf Of | Walter Moreira | Sent: 08 January 2007 06:21 | To: haskell-cafe@haskell.org | Subject: [Haskell-cafe] hacking ghci | | Hi Haskellers. A short while ago I asked about the possibility to have | the output of ghci in color. Thanks to Donald Stewart who set up a | wiki page to continue the attempt. Other people suggested HsColour and | GUI's (thanks too). I'm not so interested in highlighting the snippets | of code which ghci displays, but to use different colors for the | different types of output: different colors for the prompt, input, | warnings, exceptions, normal output, etc. | | Are any of these ideas viable?: | | 1. Hack the code of Interactive.hs in the GHC distribution and | substitute the calls to 'putStr[Ln]' by some thin wrapper which can | write with colors, according to a command line option (--color or | --colour, for example), maybe using HsColour. This looks easy | enough and I'd be willing to do it, but it's intrusive, and one has | to mantain a different version of ghci in parallel with the main | ghci. | | 2. Use GHC as library (from 6.6 on) and write a similar application as | ghci, with more emphasis in the 'interactive' part of the name (in | the same way as the relation between Python and the IPython | extended shell). This is more work and more duplicate efforts, but | it may be worthly, perhaps. | | 3. Write a wrapper which communicates with ghci via pipes. I read some | attempts about this somewhere, and people suggested an approach as | in #2. | | I haven't mentioned the GUI applications, since I would like to just | have something in the spirit of ghci (command line oriented), but with | colors or with configurable output. Which approach do you people | think it is best? | | Sorry for the long message. Cheers, | Walter | _______________________________________________ | Haskell-Cafe mailing list | Haskell-Cafe@haskell.org | http://www.haskell.org/mailman/listinfo/haskell-cafe