The problem with the current approach is that we have to copy a lot of code from GHCI that can't be used from the Ghc-API (e.g. the whole debugger file). So we should try to find out what's the minimum set of features that needs to be added to ghci to enable editor integration. Goals: ====== It should be possible to debug a program without interfacing with its ability to output/input arbitrary data to stdin/stdout. So there must be a way to support setting breakpoints and acting on breakpoints without using the ghci commandline, one example where this is needed is debugging CGI programs since stdin/stdout is reserved for communicating with the webserver. This would have another advantage since it would be possible to evaluate expressions while running a multithreaded programm that outputs a lot of data to stdout [1]. That's why there needs to be a separate communication channel that can be used to communicate with user frontends. These frontends can be IDEs, editors (VIM [2], Emacs) or just a small commandline utility using readline that looks exactly like ghci, but can be used to connect to running processes that need stdio/stdout for themselves. [1] ox/mthread/Mthread.hs [2] see wowcamldebug for an example that uses the "-s socket" option of ocamldebug http://www.bononia.it/~zack/wowcamldebug.en.html [3] you can use the ocaml debugger to debug CGIs: http://ocamlnet.sourceforge.net/intro/netcgi.html The program gets the DEBUGSOCKET env var and connects to the debugger.