Asynchronous Reliable Extensible Sleek RPC Server for Guile. It's based on nREPL protocol and can be used for programmable interactions with a running guile processes, for implementing REPLs, IDEs, test runners or other tools.
WARNING: It's in early stage of development, the API is a subject to change.
guile-ares-rs was previously known as
guile-nrepl (because it started
as just nREPL implementation in Guile Scheme). It was renamed to
avoid any confusion with network/socket REPL,
guile-ares-rs is not a
usual REPL, it's actually not a REPL at all, it's an RPC Server,
however it's possible to implement REPL-like experience with it (and
The are multiple ways to utilize Ares RS, but most straightforward is to spawn a standalone server and connect to it from a client (Emacs Arei for example):
guix shell guile-next guile-ares-rs -- \ guile -c '((@ (nrepl server) run-nrepl-server) #:port 7888)'
Don't forget to add your project source code and other dependencies to load path.
3.1. First Release Roadmap
[X]Implement eval on top of reusable threads.
[X]Implement read interception for current-input-port.
[ ]lookup operations.
[ ]Implement extension extension (swap-extension, add-extension).
[X]Change Scheme to Sleek in project description.
3.2. Open Questions
- How to work with fibers in nrepl? Maybe C-2 C-c C-e to entered to the clonned session with fibers spawned.
- Bootstrap from guile network repl? (Send guile-ares-rs implementation to remote network repl server to make it nrepl).
- Multiple guile languages support.
How to bypass continuation barrier in evaluation thread, when using previously stored continuation.
- Translation level for shrothanded nrepl base operations?
- Do we need to support meta-commands? (Probably not, it just functions, which can be exported to user or repl module scope).
4. Other REPLs Quirks
One of the reasons this project started is unfortunate missbehave of current REPL soultions in different situation and here is a list of some of them:
- Text based REPL over socket is not interruptible.
- call/cc works when pasted into prompt of the repl, but fails when evaling from buffer with C-x C-e. (when saving continuation to symbol with set!)
- It's not possible to see stdout until evaluation completed.
- Gider tests hangs repl on errors.
- CAPF function is injected, even if there is no connection to REPL and throws errors preventing other CAPFs to work.
- There is no way to provide stdin input to running expression.
- Go to definition doesn't work for with-input-from-port.
- After using
,iin REPL, go to definition hangs up.
- Go to definition opens non-existing file.
- If expression being evaluated from buffer requires input from stdin it will be frozen.
- Rebinds M-. instead of using xref.
- default clojure implementation.
- some tips.
- very simple Racket nREPL.
- lua nREPL server.
- probably most advanced 3rd party nREPL server implementation, doesn't support interrupts.
- extensions of nREPL for CIDER.
5.1.2. Debugging Tool
Q: Can I use guile-ares-rs with an existing network REPL?
A: Theoretically it's possible to upgrade existing REPL to guile-ares-rs, see bootstrap and infect modules (they can be not implemented yet).
Thanks for inspiration, help, support and motivation to Nikita Domnitskii, Maxime Devos, Andy Wingo, Bozhidar Batsov, Andrey Listopadov, Dmitrii Bogdanov, David Thompson, Dmitry Polyakov.