[Haskell-cafe] Re: More on the random idea
Simon Marlow
simonmarhaskell at gmail.com
Wed May 30 08:40:44 EDT 2007
Duncan Coutts wrote:
> On Mon, 2007-05-28 at 20:14 +0100, Andrew Coppin wrote:
>
>>> You looked at the source to GHCi itself I presume? It uses the GHC API,
>>> so it's a good place to start with building a variant of GHCi that uses
>>> the GHC API :-)
>>>
>> No. Actually, as per the wiki, I was looking at the source code to the
>> GHC API. (Apparently there isn't even any Haddock docs, despite the
>> requisit comments existing in the source...)
>
> Yes, it'd be nice to have haddock docs for it.
>
>> I suppose I could have looked at the source for GHCi - but again I would
>> imagine it's littered with error checking and other user-friendliness,
>> rather than being written to be clearly readable by beginner hackers. ;-)
>
> I suppose that's probably right. A minimal read-eval loop as a way of
> seeing how to use the ghc api would be nice.
>
>> (Also... presumably I'd have to download some giant tarball and work out
>> how to open it. And then find the source code for GHCi amoungst
>> everything else.)
>
> It's not that scary :-)
>
> http://darcs.haskell.org/ghc/compiler/ghci/
BTW, you want to look at InteractiveUI.hs and GhciMonad.hs. The rest of the
files in that directory belong to the implementation of the bytecode compiler,
and hence are *below* the GHC API. One day we'll reorganise the sources to make
this clearer.
Cheers,
Simon
More information about the Haskell-Cafe
mailing list