WinHugs for GHCi, prompt feature
Claus Reinke
claus.reinke at talk21.com
Sun Feb 12 17:04:02 EST 2006
Hi,
not a good week for such questions, as the Simons have gone on
holiday, but here are some pointers.
- check out the emacs mode for haskell, which does a similar thing
http://www.iro.umontreal.ca/~monnier/elisp/#haskell-mode
- if you are serious about this (more than just a few buttons for
the ghci/hugs commands;-), you might want to go for a tighter
integration with the interactive Haskell implementations.
of course, that should still be based on some interface, just
something more direct and more flexible than feeding the
command-line. there is no common standard (yet; another
item for haskell'?-), but
Hugs has (or had?) the Hugs Server API
http://cvs.haskell.org/cgi-bin/cvsweb.cgi/hugs98/src/server.c?rev=1.6
http://cvs.haskell.org/cgi-bin/cvsweb.cgi/hugs98/docs/server.tex?rev=1.6
GHC has the GHC API (which is also used for the Visual Studio plugin)
http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/ghc/compiler/main/GHC.hs
cheers,
claus
----- Original Message -----
From: "Neil Mitchell" <ndmitchell at gmail.com>
To: <glasgow-haskell-users at haskell.org>
Sent: Sunday, February 12, 2006 7:31 PM
Subject: WinHugs for GHCi, prompt feature
Hi,
I'm working on a Windows Haskell GUI, a lot like WinHugs (stealing a
lot of the code from WinHugs), which I want to make cross-compiler
happy - i.e. Hugs, GHCi and Yhc at least. [See
http://www-users.cs.york.ac.uk/~ndm/projects/winhaskell.php for a
really old screen shot]
The way I am operating with Hugs is by spawning a Hugs process as a
separate process, and redirecting the stdin, stdout and stderr to my
application. The hardest bit is figuring out when Hugs has run a
computation and finished, the way I am doing this currently is by
setting the prompt to escape characters, then when my program sees
these special escape characters it can determine that the computation
has finished and let the user enter the next one.
The problem with GHCi is that I haven't been able to set the prompt,
and therefore I can't detect when the computation is over, which makes
it quite hard to operate with. So what I would really like is any one
of:
1) Ability to set the prompt in GHCi
2) Some other mechanism to detect when the computation has finished
3) A way under Windows to detect when a console program is waiting on
user input (which I have been entirely unable to find, and may just
not exist)
WinHaskell is currently perfectly useable with Hugs, and maybe a month
or so away from release. I intend to start a darcs repo on tomorrow,
if anyone is interested in it.
Thanks
Neil
_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users at haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
More information about the Glasgow-haskell-users
mailing list