joyride

borkdude 2022-04-26T14:34:21.272959Z

@borkdude has joined the channel

borkdude 2022-04-26T14:34:21.520619Z

set the channel description: Come on, join the joyride! https://github.com/BetterThanTomorrow/joyride

pez 2022-04-26T14:34:25.065919Z

@pez has joined the channel

borkdude 2022-04-26T14:34:44.361789Z

set the channel topic: Come on, join the joyride! https://github.com/BetterThanTomorrow/joyride

pez 2022-04-26T14:39:33.997839Z

πŸŽ‰

pez 2022-04-26T14:40:17.455049Z

@zarkone you seemed excited about this idea. πŸ˜ƒ

2022-04-26T15:26:04.228799Z

@zarkone has joined the channel

2022-04-26T15:29:51.461799Z

hi @borkdude @pez! thanks for inviting! yes, very excited! Would be really glad to participate and see if this project could make me switch to vs code from emacs, which I was thinking impossible before I knew about it. Would be happy to help with anything: pairing, emacs expertise, etc πŸŽ‰

borkdude 2022-04-26T15:31:40.260459Z

I will certainly not switch from emacs to vscode, but I'm still excited about this ;)

2022-04-26T15:32:41.687479Z

I was thinking that would be a great experiment at least, -- at least temporary

borkdude 2022-04-26T15:33:47.450139Z

I consider vscode as my secondary editor at the very least though :)

borkdude 2022-04-26T15:34:31.101039Z

I think the target audience should be folks who already use vscode + clojure (calva users?) that want to use clojure to extend their editor experience

πŸ‘ 1
2022-04-26T15:35:17.110619Z

one thing could still hold me in emacs, even if vscode would get joyride onboarded -- GUI manipulation limitations, buffer mgmt

pez 2022-04-26T15:39:25.375879Z

Yes. VS Code is surprisingly stupid about a lot of those things. It is improving. But often with some very special solution. ”Now you can move Webviews into the Panel area”. Why? I want to move anything anywhere. There is prior art. Tons of ir.

borkdude 2022-04-26T15:44:02.944959Z

I'm just exploring the VSCode API. I found this. Show the contents of the clipboard.

(require '["vscode" :as vscode]
         '[promesa.core :as p])

(p/-> vscode/env.clipboard
      (.readText)
      (vscode/window.showInformationMessage))

borkdude 2022-04-26T15:49:39.712649Z

@zarkone if you want to take it for a spin, here's a vsix: https://www.dropbox.com/s/86h9ypuba42ydz2/joyride-0.0.1.vsix?dl=0

2022-04-26T15:50:46.945669Z

thanks! will do πŸ‘

pez 2022-04-26T16:20:50.305329Z

I just pushed a command for loading the current file.

borkdude 2022-04-26T16:21:14.461429Z

what is "the current file"?

pez 2022-04-26T16:22:15.461409Z

This is the current file

borkdude 2022-04-26T16:22:46.823009Z

hell yeah! perhaps we should use consistent words for "load" and "run" in the commands?

πŸ‘ 1
pez 2022-04-26T16:53:45.736059Z

Run goes nicely with Joyride πŸ˜ƒ But when naming this one I thought it felt more lika loading it, getting prepared for working with it... In babashka files I often have a conditional thing at the bottom which checks if the script is being run in the REPL or not, and does different things, often not doing much if it is in the REPL. Maybe we can do something similar here. Provide some variable you can check if the file was loded or is supposed to run. Then we would have two commands, one that runs, and one that loads. They will do the same if you are not checking the variable, but anyway. And loading could be named Evaluate.

pez 2022-04-26T19:21:21.306149Z

@zarkone if you haven't already, please see if the build instructions are OK enough.

2022-04-26T20:04:34.408899Z

No, but yeah, was thinking to try out both built and dev versions

πŸ™ 1
pez 2022-04-26T20:22:06.549119Z

I added a command for evaluating the selected text. Until we have an nREPL server that can compensate some, I'm thinking. However, I need to know the namespace of the file in order to be able to evaluate pieces of it with any good results. Right now I work around it like in the video. But of course better if we can use the ns form. Pondering if I should expose Calva Paredit from Calva's API then we can use that and users will have a consistent experience with how Calva sees things. But also, I don't know if I'm ready to start considering other users of the Paredit API... Maybe just expose some well selected functions? Advice welcome. Also advice about alternative approaches. Just grabbing the namespace symbol can be somewhat reliably done with a regex. Calva did it that way for a pretty long time. I'm also looking at the loadFile example on the SCI page, but I don't understand it well enough to figure out if I could go that way.

borkdude 2022-04-26T20:24:28.717639Z

I think it's better to implement a proper nREPL instead of a sub-optimal near-REPL

borkdude 2022-04-26T20:25:05.048889Z

although perhaps it already works if you first eval the ns form?

pez 2022-04-26T20:26:13.347459Z

Yeah, it actually does.

borkdude 2022-04-26T20:26:35.060129Z

it's not so hard to parse the ns form, but maybe you can make an issue and let me do that

borkdude 2022-04-26T20:26:42.996449Z

since that's more in the SCI side of things

borkdude 2022-04-26T20:27:24.253599Z

we could probably re-use some stuff from nbb's nrepl thing eventually when we want to have proper nREPL

pez 2022-04-26T20:27:24.270939Z

Yeah, that or it is on the Calva side of things πŸ˜ƒ

borkdude 2022-04-26T20:27:43.070179Z

I think it's better to not couple this to any specific plugin

pez 2022-04-26T20:27:46.578759Z

> when we want to have proper nREPL Like now? πŸ˜ƒ

borkdude 2022-04-26T20:28:18.215429Z

E.g. with nbb I don't require people to install bb as well. It's good to keep stuff separate

pez 2022-04-26T20:28:56.111839Z

Yeah, but we can enable things if they are available and otherwise not.

pez 2022-04-26T20:29:25.517799Z

But, I hear you. Will chill with the Calva track.

borkdude 2022-04-26T20:29:46.557219Z

> Like now? I think it's better to focus on the initial features and make them ready, then incrementally do the more difficult stuff. nREPL is not hard, but it will take a few hours

pez 2022-04-26T20:30:24.450589Z

An API from Calva will need to be exposed at some point to allow users to take Calva on a Joyride.

borkdude 2022-04-26T20:31:02.233139Z

yes, but this is on the level of letting users call that from their scripts, not a hard requirement to use joyride

pez 2022-04-26T20:32:21.996929Z

My thinking above was not about a hard requirement either. More like ”features that enable if you have Calva installed”.

borkdude 2022-04-26T20:32:41.595749Z

right πŸ‘

pez 2022-04-26T20:33:36.601859Z

Featurewise we are not far from where nREPL is the next step, I think.

borkdude 2022-04-26T20:34:01.553439Z

if you have calva installed, you can probably launch a joyride nrepl, connect to it and then do stuff like with any clojure script? not anything specific to joyride I think?

pez 2022-04-26T20:37:55.801269Z

Yes and no. When Joyride has an nREPL server you will be able to connect to it and have the same level of REPL tooling support as nbb has (so not full cider-nrepl, but enough to be productive). However, I think I will also make something special or something general with Calva to allow it to be connected to both Joyride and your project.

borkdude 2022-04-26T20:38:59.058019Z

So perhaps joyride should expose a VSCode API to launch an nREPL server which returns the port and possibly more stuff and calva could call that API?

pez 2022-04-26T20:39:00.211199Z

As it is now it takes: 1. connect to Joyride, 2. do things 3. connect back to your project

pez 2022-04-26T20:40:20.097889Z

Easier if we spit out the port in the .joyride folder. That kind of ”API” Calva is already prepared for.

borkdude 2022-04-26T20:41:14.686039Z

makes sense. but let's say, if the user selects in calva "connect to repl in project, aka jack in" > "joyride", then it needs to call something in joyride right?

borkdude 2022-04-26T20:41:18.692099Z

to start the nrepl

borkdude 2022-04-26T20:41:32.826659Z

since it's not a command line thing it can call like bb or nbb

pez 2022-04-26T20:42:44.792809Z

I'm thinking that when Joyride activates it will start an nrepl server and users will not start it, but rather connect.

borkdude 2022-04-26T20:43:28.767759Z

but joyride always activates and I don't think it's clean to always start an nrepl since that uses an open port, etc.

borkdude 2022-04-26T20:44:09.037809Z

perhaps just a joyride.startNRepl and joyride.stopNRepl could work

borkdude 2022-04-26T20:44:12.045599Z

commands

pez 2022-04-26T20:44:25.450549Z

I could go with unclean. But we can have a command for it. And we don't need to always activate Joyride either.

pez 2022-04-26T20:44:40.012989Z

Yeah, you had the same idea.

borkdude 2022-04-26T20:45:22.110669Z

but if instead of a command we expose a VSCode API, then Calva could do that work when the user selects "joyride"

borkdude 2022-04-26T20:45:31.403049Z

that seems more in line with how it's done for other tools

pez 2022-04-26T20:46:13.361679Z

Could do what work?

borkdude 2022-04-26T20:46:29.836819Z

tell joyride to start the nrepl

pez 2022-04-26T20:47:09.102899Z

Calva would use the commands, was my thinking.

borkdude 2022-04-26T20:47:50.912079Z

ah yes, that works

pez 2022-04-26T20:48:12.650549Z

And the Joyride user will want those commands too if we think it's dirty to just always start it. (I don't think that's very dirty).

borkdude 2022-04-26T20:48:45.904059Z

I do. if you have n windows open , there will be n ports open, not a fan of that

borkdude 2022-04-26T20:49:30.894219Z

we could make that a configuration option of course, if you insist :)

pez 2022-04-26T20:49:40.810929Z

Then commands. Otherwise people will have to use Calva to start the repl and then connect Emacs if that's where they fancy to work from.

borkdude 2022-04-26T20:50:42.685429Z

I think joyride's audience is VSCode users ;)

pez 2022-04-26T20:51:36.484209Z

> we could make that a configuration option of course, if you insist Not a fan configurable options. πŸ˜ƒ But this one makes sense. Then at least it is not dirty.

borkdude 2022-04-26T20:52:08.686799Z

> Not a fan configurable options. Then why do we have an option for user and workspace script directories ;)

pez 2022-04-26T20:53:04.372849Z

That's because I like the Ux it creates.

borkdude 2022-04-26T20:53:49.694369Z

I mean, you would have the same UX if these would be always .joyride/scripts

borkdude 2022-04-26T20:53:54.922129Z

without the option to change that

borkdude 2022-04-26T20:54:17.503169Z

(I'm totally fine with the option, just challenging your "don't like configurable options")

pez 2022-04-26T20:54:27.438629Z

That's what we are planning, right? At least I. πŸ˜ƒ

borkdude 2022-04-26T20:55:04.839729Z

That's not what you wrote here though: https://github.com/BetterThanTomorrow/joyride/blob/master/doc/configuration.md β€’ joyride.scriptsPath.user: An absolute path β€’ joyride.scriptsPath.workspace: A workspace relative path. Defaults to .joyride/scripts.

borkdude 2022-04-26T20:55:33.953309Z

(I added the default sentence after it since it wasn't clear what the default was)

pez 2022-04-26T20:55:34.706249Z

It is more like that my default answer for if something should be configurable is No. But if I need it for something, then I add it.

borkdude 2022-04-26T20:56:04.850389Z

I agree, but here we didn't even need it yet

pez 2022-04-26T20:56:11.336549Z

Yes, defaults makes sense. The current setting we have for this has a default too.

borkdude 2022-04-26T20:56:14.935449Z

(and it's also currently not implemented)

pez 2022-04-26T20:57:37.187999Z

Ah, I missed a key word there, you said ”without”, I read ”with”.

borkdude 2022-04-26T20:58:13.337659Z

I agree that we should not add options for the sake of adding options. But we seem to have documented options that 1) aren't implemented 2) haven't been requested by anyone yet. Those were my points

pez 2022-04-26T20:58:16.217699Z

Here's the reason I want this configureable the way I have suggested:

borkdude 2022-04-26T20:58:33.057529Z

brb

pez 2022-04-26T21:08:22.302329Z

VS Code has User and Workspace settings. Workspace settings take precedence. So if I would like a different set of Joyride workspace scripts for a particular workspace than my colleagues have, I can configure that in my User setting. It's a kind of flexibility I like to have. Or maybe I have my user scripts on a memory stick and use several computers. Idk. Just makes sense to me.

pez 2022-04-26T21:12:20.078109Z

And monorepos.

pez 2022-04-26T21:13:37.492929Z

However, things have also changed since I frist scetched this. So maybe we can chill with the settings and see what kind of needs arise.

borkdude 2022-04-26T21:13:47.978039Z

ok. What I also wondered: you will bind $workspace/.joyride/scripts/foo.cljs to a hotkey. But that hotkey only makes sense within that specific workspace... but VSCode doesn't have the concept of workspace-local hotkeys right?

pez 2022-04-26T21:14:43.199609Z

Good catch! ... Maybe it has. Let me check.

borkdude 2022-04-26T21:15:46.827749Z

but this is why you have the menu with the workspace scripts

borkdude 2022-04-26T21:17:12.731539Z

ok, so you can have local .vscode/settings.json and you can use these settings in a when in the global hotkeys

pez 2022-04-26T21:20:34.553389Z

Checked, there is no such when context. But we can add it.

{
    "key": "cmd+1",
    "command": "joyride.runWorkspaceScript",
    "args": "my_ws_script-foo.cljs",
    "when": "joyride:workspacePath ~= /project-foo/"
  },
  {
    "key": "cmd+1",
    "command": "joyride.runWorkspaceScript",
    "args": "my_ws_script-bar.cljs",
    "when": "joyride:workspacePath ~= /project-bar/"
  },

pez 2022-04-26T21:21:01.221259Z

Well, something like that. πŸ˜ƒ

borkdude 2022-04-26T21:22:55.830679Z

is ~= a thing? what does that mean, a regex?

pez 2022-04-26T21:23:27.251989Z

Yeah, I'm not sure if that's the syntax. It is in awk πŸ˜ƒ

borkdude 2022-04-26T21:23:45.599969Z

so you're just making stuff up now? ;)

pez 2022-04-26T21:24:16.927719Z

πŸ˜ƒ I know you can match on regexes. So just the syntax could be a bit off.

borkdude 2022-04-26T21:24:42.805659Z

fair enough :)

pez 2022-04-26T21:24:58.919229Z

Calva is using quite a few when context things.

pez 2022-04-26T21:26:31.593689Z

But that SO answer would work too. Maybe better to document our way around it.

borkdude 2022-04-26T21:27:02.657829Z

wasn't what you were doing similar to the SO answer?

borkdude 2022-04-26T21:27:39.211079Z

I see you are using a colon in joyride:workspacePath , does that have a special meaning?

pez 2022-04-26T21:27:56.605029Z

Similar. But my idea wouldn't need a workspace level setting. Which I often try to avoid.

pez 2022-04-26T21:28:54.860509Z

Funny about the colon. I was asked the other day. No, I don't think it has a meaning. I think I picked it up from some example and now it's what I use in Calva.

borkdude 2022-04-26T21:29:35.118199Z

I gotta wrap up. To conclude, I think we should have a fully working minimal thing and ship it. Then wait a bit for user feedback. Then the next iteration (nREPL support).

pez 2022-04-26T21:31:12.735239Z

I might want to have a few things in place before shipping. But putting it on the marketplace and just tell our friends around here to start testing I am cool with, without too much structure.

borkdude 2022-04-26T21:32:06.521649Z

ok, then I think having some more structure about what are the items that should go in before shipping, e.g. an issue with some items in it, would be nice

pez 2022-04-26T21:32:52.586849Z

Yes, I'll file an issue or two.

borkdude 2022-04-26T21:33:06.374069Z

sounds good. g'night!

pez 2022-04-26T21:34:20.626399Z

Part of my plan here is that Joyride could be a vehicle for growing Clojure. But Clojure w/o a REPL ... So for me I think I want a REPL before shipping. πŸ˜ƒ

pez 2022-04-26T21:34:35.377909Z

Good night!

borkdude 2022-04-26T21:36:10.106689Z

My thinking is that we should test if this idea is something users want, before putting too much energy in it. The energy comes from usage (for me personally). If there isn't any usage, I see it as a waste of time to put many hours in nREPL support.

borkdude 2022-04-26T21:37:44.707509Z

It's similar with #obb - a REPL if of course planned, but I don't think there are currently enough users and the people who have requested a REPL is 0 or 1 maybe

borkdude 2022-04-26T21:39:57.237449Z

Just evaluating your whole script is good enough for now to see if this peeks more interest

borkdude 2022-04-26T21:45:05.127459Z

In that sense your evaluate selection is a good proxy

borkdude 2022-04-26T21:45:20.464409Z

I'll take a look at the namespace parsing tomorrow hopefully

pez 2022-04-26T21:45:50.973529Z

Since it is temporary we can also just regex it. πŸ˜ƒ

borkdude 2022-04-26T21:46:05.351099Z

neh, it's not that hard to do it with SCI

borkdude 2022-04-26T21:46:39.034949Z

I think we should even eval the ns form before the selection, I think CIDER does that too

pez 2022-04-26T21:47:35.838489Z

Maybe. Calva only evals (in-ns ...) . Never evals stuff you haven't told it to evaluate.

borkdude 2022-04-26T21:48:25.503609Z

Maybe. Also, the ns stuff requires some more changes in how we eval, eval-string* is no longer sufficient. I'm working on an in-browser nREPL server at the moment (for clerk and scittle) where I'm doing something similar

borkdude 2022-04-26T21:50:18.743979Z

Well, maybe with some luck I can copy the nbb nREPL stuff to joyride and it'll be not too much work... :-S but optimally I want to factor out the common parts and do it cleanly...

borkdude 2022-04-26T21:50:43.289229Z

anyway, now I'm really away :)

πŸ’€ 2
pez 2022-04-26T21:58:02.131639Z

Do the factoring if Joyride takes off? 🧌