Email or username:

Password:

Forgot your password?
Andrew Tropin

Is it Modern Scheme REPL?
- Interruptible evaluation in remote Scheme process? ✔
- Immediately seeing stdout and stderr of remotely evaluated expression? ✔
- Readable exception messages? ✔

A couple things still bother me:
- How to intercept access to stdin (current-input-port)? Need to make custom ports?
- Evaluation happens in a fresh thread every time: 1. constantly creating new threads is not optimal 2. it doesn't allow to invoke previously saved continuation.

#guile #scheme #lisp #emacs

6 comments
dave

@abcdw yeah it would be nice to have explicit control over which thread is performing the evaluation like guile's cooperative repl. that repl was designed to integrate into async event loops (though it uses polling whereas a more modern design would use async i/o) where the evaluation often needs to happen in a "main" thread, not the thread of the repl client.

Andrew Tropin

@dthompson Maybe it would be also cool to start evaluation in fiber, but I'm not yet fluent with its internals and at the moment don't know how to suspend/interrupt evaluation.

Also, I thought about reconstructing stack inside newly created thread, so the continuation can be performed without crossing continuation barrier. IDK yet how good this idea is :)

Andrew Tropin

@dthompson The documentation on coop server is kinda sparse, so I went reading the sources. It seems it spawns a thread, and you can enqueue some operations for it and call poll-coop-repl-server to perform the last queued operation on that thread, right?

Andrew Tropin

@dthompson I found system-async-mark, it seems I can have interruptible eval and don't need to stop the thread for that!

It will also solve the continuation barrier problem and also will prevent spawning a new thread for each request!

Go Up