Fork me on GitHub
#calva
<
2021-10-30
>
janezj12:10:45

Hi, I am designing a long time running server (hooked on websocket, processing messages and building a state). The app will have admin interface - nrepl server and admin console (calva connected to nrepl). This is not a problem, done in two loc. Console should be so powerful to enable changing the code of the server in runtime. But I wish that experience in console to be as awesome as it is when developing in Calva (autocomplete, clj-kondo) I would also like to have somekind of notebook output - maybe notespace. I_'m_ interested in your thoughts.

pez12:10:02

Modifying the server shouldn’t be trickier than that you have an nREPL client and the eval op implemented. Feel free to rip out Calva’s bencode and nrepl client for this. The rest… CodeMirror comes to mind. If it has an LSP client you could leverage cloojure-lsp and get pretty far. If it doesn’t, then you have a lot of work to do. 😃

pez12:10:46

Have you considered building the console as a VS Code extension, in a webview? Then Calva could be used as is.

borkdude13:10:45

Isn't it easier to just use the ssh plugin of vscode: connect to a machine via ssh and start coding on that machine?

janezj13:10:08

Thanks @U0ETXRFEW, I just want to be able to find out what the server is doing, visualize some stuff and tweak current processing. Alan Kay was talking about Systems, so this is my experiment based on his idea. Calva as nrepl client is perfect. I would like to hack in runtime, and make as much changes possible without restart. Literally developing in production.

janezj13:10:13

ssh could be used, I am going to to secure the transport with ssh port forwarding. But when I start app with nrepl server, there is now magic you are providing in "jack in"

borkdude13:10:18

You could leave an nREPL server running production and then use "connect to nREPL outside of project"

borkdude13:10:44

This is what I've used in most clojure production systems over the years

pez14:10:52

That’s about what I meant by building your console in VS Code. You would run it locally. If you wanna go more full out Alan Kay you could put Nightcode or Liquid in your server. Then you can modify both the editor and the server as they are running, using the same REPL. 😃

janezj14:10:09

Everything works perfectly, "code . -n" solves my real problem, I tried to launch second vscode (one for local, one for remote) so I changed the directory, and of course calva was unable to play with sources (brown-bag-over-my-head emoji)