joyride

zimablue 2022-10-24T17:22:43.069329Z

Does joyride (or calva not sure which) facilitate repl-initiated communication? Eg. the runtime decides to send a message to calva/joyride, and somewhere in calva/joyride we can write handler code?

borkdude 2022-10-24T17:51:48.876549Z

This would be a question for @pez

pez 2022-10-24T19:41:37.654079Z

We don't have that. What's the use case? I wonder if it is Joyride or Calva that would be supporting this.

pez 2022-10-24T19:47:56.912579Z

I don't think this can be used as a workaround, but I haven't tried. In Calva's https://calva.io/api/#replevaluatecode there are two callbacks, for handling stdout and stderr, respectively. Maybe (probably not) you can start a thread in the runtime (assuming it is Clojure) which prints to stdout and then use the callback. The reason I don't think this works is that I don't think we channel stdout back to the callback, once that evaluation has returned. I might be remembering this wrong, though.

zimablue 2022-10-24T20:30:06.900069Z

Another personal usecase, basically having a UI where I can click things and it sends itself back, I guess portal sends things back to the repl using its own system not all the way back to calva

zimablue 2022-10-24T20:30:39.477779Z

Sends itself back to vscode* I'm trying to deeply integrate my UI development with my IDE

zimablue 2022-10-24T20:35:16.703879Z

I guess maybe I could open some sort of two way communications protocol in joyride, connect that to the runtime myself, then on ping from the runtime, run a command or calva API? That sounds like the most direct way to implement it without direct calva cooperation?

borkdude 2022-10-24T20:36:53.813409Z

yes, you could open a socket server

borkdude 2022-10-24T20:37:09.542209Z

node is available to you

zimablue 2022-10-24T20:38:13.599889Z

This might be something that's much more convenient using joyride and useful for other people

zimablue 2022-10-24T20:39:34.202949Z

@pez could I do the reverse and instead of using customcommands in calva somehow fire the communication from vscode->calva ->joyride->runtime instead of worrying about the customcommand interface?

zimablue 2022-10-24T20:42:47.144919Z

Instead of having messages go 1. vscode-->>calva--customcommand>>repl-->>runtime and in reverse 2. runtime-->>joyride-->>vscode have the first flow be vscode-->>calva--?>>joyride-->>runtime

pez 2022-10-24T20:46:07.281839Z

Not quite following. 😃 But with the API I posted above you don't need to worry about custom repl commands. You can evaluate whatever code you want in the runtime from joyride.

zimablue 2022-10-24T20:46:30.334699Z

Yeah that's what I was trying to ask I think, thank you

pez 2022-10-24T20:48:04.060759Z

The Calva extension API has some functions for getting the current form and some few other friends you might recoginize from custom repl commands. Check the ranges part of the API on the same page.