Last day I wrote simple remote REPL functionality.
It may be useful for someone, who like to work with gambit on remote basis.
See attachment for details.
Vasil.
Afficher les réponses par date
On 21-Mar-09, at 8:25 AM, vasil wrote:
Last day I wrote simple remote REPL functionality.
It may be useful for someone, who like to work with gambit on remote basis.
See attachment for details.
Vasil.
Nice! I have two comments:
1) You should use the new more user-friendly notation to pass the host and port parameters, i.e. "localhost:6000", or ":6000", or "localhost" as the server-address parameter.
2) I'm not sure why you need to patch _repl.scm... if you need access to macro-thread-repl-channel-set! you can (include "~~lib/ _gambit#.scm") . Doing this would make it easy to use your code from a pristine gsi.
Marc
Marc Feeley wrote:
Nice! I have two comments:
- You should use the new more user-friendly notation to pass the host
and port parameters, i.e. "localhost:6000", or ":6000", or "localhost" as the server-address parameter.
- I'm not sure why you need to patch _repl.scm... if you need access to
macro-thread-repl-channel-set! you can (include "~~lib/_gambit#.scm") . Doing this would make it easy to use your code from a pristine gsi.
Marc
1) Done
2) Thanks for reminding :) I forgot to look at _gambit#.scm at all. Done.
3) But patch for _repl.scm is still required :(. In order to properly close connection on return from repl to continuation, I make one extra optional parameter in ##repl-within. This parameter is used to pass lambda, which is used to close network connection and clean-up. And I made some changes to ,v command behaviour to save repl-channel and to restore it.
See attached file.
Any suggestions and comments are welcome.
PS: Today I've tested rrepl on several computers running termite (I slightly changed termite base exception handler). And found this way of debugging remote threads very useful. Especially repl-within-tcp-client-start! May be later I make changes in emacs gambit.el to handle incoming connections and starting debugging with source files.
Vasil
I figured that remote repl works fine, when included in _repl.scm: (##include "rrepl.scm") But if it is loaded as module it does not work properly. repl-tcp-server-start! - works fine repl-tcp-client-start! - works fine but repl-within-tcp-client-start! - hangs gambit in memory eating loop sometimes. I Suppose that problem in infinite recursion of exception handler on some rare deadlock moments. Cannot figure why yet. It is very hard to reproduce this error.
Last version have many improvements, and when compiled into gambit works very stable, even on unexpectedly terminated connections.
Last version of rrepl is in attachment.
Marc, could you take a look at repl-within-tcp-client-start! procedure ? May be I misunderstand REPL mechanism and threading at some points?
Vasil.