"Talking" with the compiler

Duncan Coutts duncan.coutts at worcester.oxford.ac.uk
Mon Jan 19 17:05:28 EST 2004

On Mon, 2004-01-19 at 11:34, Simon Marlow wrote:
> For the Visual Studio plugin we're going to need to talk to GHCi.  We
> plan to do this by designing an appropriate API for GHCi and calling it
> directly; you *could* do it by talking over a pipe, but it's going to be
> a lot of work (and slow).  If you want to do this, please talk to us
> about what API you'd like to see, and we can hopefully implement
> something that will be generally useful.

I wanted something like that for a Haskell IDE I was working on (not
much progress on it at the moment, but I may pick it up again).

The main things I wanted was enough information to be able to implement
"jump to definition". Where you select a symbol in your editor and move
to where that variable/function/type/class was defined, in the same
module or another module.  It would also be useful to find out the
module and package a symbol comes from so that an IDE could have a good
stab at finding some documentation.

For that, you'd want an API for wandering through the useful information
in .hi files. An API corresponding to hugs/ghci's :info <name>, :browse
<modname>, :type <name> would be a good start. You'd want to be able to
specify which root module to load up the symbols for, optionally
specifing a search path and expect it to also load up the .hi files for
any imported modules.

For what I wanted, the ability to evaluate/compile expressions was not
necessary, just to browse through symbol information.


More information about the Glasgow-haskell-users mailing list