Repository navigation
Changes for connections from the web browser - #879
dkochmanski wants to merge 1 commit into
Conversation
|
And for some reason the CI breaks on CCL. |
|
I'll look into CCL tests not passing tomorrow. Thanks for reviewing these changes. EDIT: CCL failure was caused by not having all gray stream protocol operators implemented and exported. I've withdrawn the part that pulls symbols to swank's gray package because of that and left only essential parts. |
|
I've submitted a minimal set of changes to slime.el and for ecl backend (as requested) and they were merged some time ago. The only remaining change is to introduce This style is meant for swank communicating through a stream, where the user implements the gray protocol that handles the communication without assumptions that there is an underlying file handler (many backends make that assumption). It is called Why singlethreaded-connection or multithreaded-connection are not enough:
Contrast this with the variant for async connection, where This second version ensures, that when there is no timeout, we will proceed straight to When a condition is signaled, we enter sldb-loop to allow debugging the condition from emacs. Understandably, to preserve context, it doesn't return until we are done with the debugger. So In my port, So if This set of changes does not impact existing code paths, so it should be safe to merge. I also think that it is a useful general-purpose solution for communication that levereges gray stream protocol in a backend-independent way. |
|
Is there code anywhere that uses this new functionality that I can look at? |
|
Yes; there are even two clients, so you can try it from SBCL without building WECL in the browser.
load this file in emacs and evaluate the form
sbcl --load slug.lisp --load frig.lisp This should open a new repl in the emacs session. Note that frig.lisp assumes that quicklisp is present and loads "websocket-driver-client" and "bordeaux-threads" system
This client runs from the browser, i.e using a page like this: you may try it without cross compiling ecl here: https://turtleware.eu/static/misc/wecl-20250821/slug.html, when you click "Connect", it will try to connect to the server created by lime.el at port 8889 at localhost. Note that loading the page first time may take some time depending on your internet connection, because wecl.wasm is around 10MB. |
With this method we do not consider the standard output like with a single-threaded mode, and waiting for event relies on a blocking read from the stream (that may be asynchronously updated).
|
rebased against current master. |
|
I've been meaning to review it, but I'm always busy with other stuff, and I don't want to hastily introduce new APIs to be stuck with it forever after. |
|
Any update on this? technically I'm also slime dev, so if anything breaks due to this new API I will address the issue when @mentioned. |
This set of changes introduces a new connection type
:ASYNCthat relies on Gray Stream interfaces. Moreover SLIME-NET-SEND anticipates that the connection may be associated with a websocket, and if that's the case we use a specialized function to send data.With these changes I've managed to successfully connect from an image running inside the web browser to a shim server bridging SLIME and websockets.