Replies: 4 comments
-
|
Basic "http repl" example working so far, just to see that code can modify the server process runtime state before doing any more advanced plumbing beforehand. Based on AMPHP event-source.php example, using Datastar library for swapping streamed html partials to view. rend.mp4Source: https://codeberg.org/jasalt/phel-snake-online/src/branch/main/src/httprepl.phel |
Beta Was this translation helpful? Give feedback.
-
|
nREPL allows using various transits but default is bencode, so wrapped a encoding/decoding PHP library so that it can be installed as composer dependency and called with Phel functions / data structures: https://packagist.org/packages/jasalt/phel-bencode Streaming encoding/decoding is not implemented which seems to be the main way in mainstream nRepl server implementations but buffering line by line as done currently seems to work good enough for now while testing the overall implementation. |
Beta Was this translation helpful? Give feedback.
-
|
Early version with Talking bencoded nREPL commands over socket to nREPL process, raw messages being: d2:op8:describee = {:op "describe} d4:code7:(+ 1 1)2:op4:evale = {:op "eval" :code "(+ 1 1)"} |
Beta Was this translation helpful? Give feedback.
-
|
I got the Calva/VSCode connection working! There's some nREPL client specific glitches still, but I think connection should work with other text editor clients also (Neovim, Cursive, ...). Working primarily with Emacs Cider client myself but this should allow for better collaboration across editors regarding REPL stuff. linux_desktop_recording-2025-03-30_13.48.35.mp4Mirrored the repo to this platform also for convenience https://github.com/jasalt/phel-nrepl where issues can be posted with reference to Phel issue tracker. Continuing with tidying up the ops so completions would render properly etc. and looking how to make get REPL |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Disliking that async AMPHP server code needs a restart after every code change so I started to try puzzle together nrepl server for Phel using amphp libraries (byte-stream) that could run in same event loop as the http-server. Then application could be developed interactively.
In general, I think it could provide better text editor integrations for interactive development with existing tooling (Emacs Cider, VSCode Calva, Cursive, Neovim ...), if it can be made work.
Wrapping my head around bytestreams currently. Noted some useful pieces in ilt-phel for inspecting Phel runtime info.
Beta Was this translation helpful? Give feedback.
All reactions