
Hi, I've now got a working OpenGL test-bed and I have also written myself a "GLI" as I call it, openGl command Line Interface... a forkIO thread that listens on port 3000 and once my program is up, I telnet in and issue commands to it so I can fiddle with OpenGL whilst it is running. I can change the camera position and angle and issue a few simple commands to affect the rendered environment so I can better understand how OpenGL works. If it works well and the code isn't to amateurish I will github it I guess! However, it seems to me that I am re-inventing the wheel to some degree: I am opening a socket, getting input, parsing it and executing commands.... what I would really like to be able to do is to *use* the already pretty slick ghci interface instead... ...so, is there a way to create an instance of it and attach it to the socket? f I run my app from within ghci it still works but the event loop steals any further input. So, is it possible. I *did* manage this with SLIME and Emacs some years ago albeit the slime funtionality was a little broken but I could actually recompile code and have it affect the still running application. I've also been using Parsec latelt and the "wai-handler-devel" also entered my mind as an option but I only want a simple CLI after all! :) Thanks for your upcoming suggestions..... Sean

Hey! I don't know how to answer your question. I just wanted to say that some kind of integration of GHCi with the internals of a running program may be useful as a 'manhole', e.g. on web apps. Something like what Twisted have [1]. Cheers! [1] http://www.lothar.com/tech/twisted/manhole.xhtml -- Felipe.

On 10/07/11 18:57, Felipe Almeida Lessa wrote:
Hey!
I don't know how to answer your question. I just wanted to say that some kind of integration of GHCi with the internals of a running program may be useful as a 'manhole', e.g. on web apps. Something like what Twisted have [1].
That'smy point! I have *already* done that, I just "telnet localhost 3000" and I get a prompt up I can enter commands that I have implemented. What I am after is if I can embed the GHCI code and just have it work... until then I am continuing down my chosen path with it to just get it working
Cheers!

On Sun, Jul 10, 2011 at 12:43, Sean Charles
what I would really like to be able to do is to *use* the already pretty slick ghci interface instead... ...so, is there a way to create an instance of it and attach it to the socket?
Sort of. See http://www.haskell.org/haskellwiki/GHC/As_a_library; in particular, http://www.haskell.org/ghc/docs/latest/html/libraries/ghc/InteractiveEval.ht... is probably of interest. I don't know how much of GHCi you'd have to reimplement, though — the library is there, and does everything GHCi does, but I don't think it includes the REPL per se. Looks to me like you'd need to implement your own parser for ":"-commands and "import". -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms
participants (3)
-
Brandon Allbery
-
Felipe Almeida Lessa
-
Sean Charles