chlorine-clover

About Chlorine for Atom and Clover for VS Code: https://atom.io/packages/chlorine and https://marketplace.visualstudio.com/items?itemName=mauricioszabo.clover
seancorfield 2020-11-09T01:08:57.174200Z

And I just set it all up on my Windows Surface Laptop: very slick! VS Code + WSL extension so all the code / REPL / etc live on the Linux side, but the editor lives on the Windows side, which is nicer than what I was doing for Atom (running it on WSL via Xlaunch).

2020-11-09T05:35:26.175200Z

haven't tried any custom things, but clover 0.2.1 seems to be working fine here via a socket repl with a deps.edn project :thumbsup:

2020-11-09T05:36:46.175300Z

2020-11-09T05:42:13.176500Z

ah is that reveal on the right?

seancorfield 2020-11-09T05:42:20.176700Z

VS Code (macOS), Reveal, Socket REPL. All works beautifully. Also on Windows/WSL!

2020-11-09T05:42:40.177Z

great to have pieces that work well together ๐Ÿ™‚

seancorfield 2020-11-09T05:42:56.177400Z

I am so impressed with what Mauricio has done here!

โœ”๏ธ 2
๐Ÿ˜‰ 1
seancorfield 2020-11-09T05:43:39.178300Z

On Windows, with WSL, where VS Code native on Windows can talk to WSL and have all the files and the REPL and everything running on Ubuntu... so slick!

seancorfield 2020-11-09T05:43:55.178700Z

(with Atom, it isn't quite as slick)

seancorfield 2020-11-09T05:44:32.179200Z

Now all we need is the repl-tooling stuff integrated into a nice Socket client for Emacs, eh? ๐Ÿ™‚

2020-11-09T05:45:31.179900Z

i am not sure i understand how that would work

2020-11-09T05:46:13.180200Z

i thought repl-tooling was written in cljs

seancorfield 2020-11-09T05:46:28.180500Z

I know. I'm just "wishful thinking" ๐Ÿ™‚

2020-11-09T05:46:34.180700Z

๐Ÿ™‚

seancorfield 2020-11-09T05:46:48.181100Z

I just wish there was a serious alternative to CIDER/nREPL.

2020-11-09T05:47:12.181400Z

i get by with my custom spartan stuff ๐Ÿ˜‰

2020-11-09T05:49:22.181600Z

have you ever tried monroe?

seancorfield 2020-11-09T06:09:32.181800Z

What is Monroe?

seancorfield 2020-11-09T06:09:52.182Z

Oh, still nREPL. Ugh!

seancorfield 2020-11-09T06:10:19.182400Z

I do not want nREPL in my production processes!

seancorfield 2020-11-09T06:10:49.183100Z

With Socket REPL, I have no additional deps. I can choose to start any process with a REPL. I can connect to it from Atom/VS Code.

seancorfield 2020-11-09T06:11:08.183600Z

Or Unravel. Or telnet/nc/whatever.

seancorfield 2020-11-09T06:11:26.183800Z

No nREPL.

2020-11-09T06:27:33.185400Z

ah ok. well i don't usually use nrepl either (my custom stuff is socket-repl based) and am grateful that chlorine and clover provide the option of using a socket repl.

2020-11-09T06:28:16.186Z

i can appreciate not having additional things in my clojure processes, but it seems that for practical reasons it is hard to avoid if one uses rebl or similar.

mauricio.szabo 2020-11-09T11:30:25.186700Z

Wow, great to know that everything is working well!

๐Ÿ‘ 1
mauricio.szabo 2020-11-09T13:03:20.190100Z

CLJS is a great language for editor plug-ins, really. VSCode's API is incredibly limited (specially the "webview API" that I use for the console) but even-then, hot-reload works- it's almost magic!

2020-11-09T13:03:33.190300Z

\o/

borkdude 2020-11-09T13:07:14.190700Z

Why is prepl not so popular? I hardly know any tool that uses it

2020-11-09T13:07:31.191100Z

Olical is a good person to ask

2020-11-09T13:07:40.191700Z

i think he said it's broken in a few ways

mauricio.szabo 2020-11-09T13:10:21.194400Z

There are some issues with reader conditionals, tickets that are not being addressed that makes it hard for tooling to work with, the same problems with old "contrib" tools (release cycles that are too long, tied to the Clojure releases, hard to contribute), and I had some problems with concurrency (you send a command and it becomes confused on what to print)

mauricio.szabo 2020-11-09T13:10:58.195Z

These are only my experiences, but it was quite some time ago

2020-11-09T13:11:08.195200Z

thanks for that summary

borkdude 2020-11-09T13:11:28.195400Z

@mkvlr ^

mkvlr 2020-11-09T13:18:10.197500Z

@mauricio.szabo but does that invalidate the whole idea of an edn-based protocol that can be upgraded at runtime? Can still do all those things in user-land to work around the contribution/release problems? Imo being able to upgrade a plain socket repl like unrepl without requiring extra deps is a clear win.

mauricio.szabo 2020-11-09T13:19:53.198700Z

Yes, that's one of the reasons I'm using UNREPL for now - it upgrades over a plain socket repl

mauricio.szabo 2020-11-09T13:20:40.200Z

But unrepl also only works for Clojure, so there is some detection I do before upgrading things.

mkvlr 2020-11-09T13:23:16.201Z

ah, youโ€™re using unrepl, great.

mkvlr 2020-11-09T13:24:00.202200Z

so weโ€™re on the same pageโ€ฆ

mauricio.szabo 2020-11-09T13:26:02.205400Z

Yes, but unfortunately unrepl is quite complex... I'm having a hard time trying to fix a bug on it when you evaluate Datahike's transact functions

mauricio.szabo 2020-11-09T13:27:40.208800Z

I'm thinking about an easier "EDN-based upgradable REPL" that could be easier and also work with other clojure implementations like CLR, Magic, Arcadia, Lumo and Clojerl.

mkvlr 2020-11-09T13:27:42.208900Z

yes, weโ€™ve been struggling there, too. Would be ๐Ÿ’ฏ to have a version of this idea that we could settle and depend onโ€ฆ

mauricio.szabo 2020-11-09T13:35:52.209Z

Are you also working on some tooling over unrepl?

mkvlr 2020-11-09T13:51:34.209200Z

yes, nextjournal is using unrepl and prepl

mkvlr 2020-11-09T13:51:58.209400Z

weโ€™re in the process of migrating to preplโ€ฆ

mkvlr 2020-11-09T13:52:14.209600Z

or rather our own prepl inspired thing but itโ€™s not fully stable yet

mauricio.szabo 2020-11-09T13:53:13.209800Z

That's great news! Is the code already available somewhere? I want to take a look (I'm also looking to migrate away from unrepl, but I don't want to re-re-reinvent the wheel)

mauricio.szabo 2020-11-09T13:53:45.210Z

I was even looking at making the "Babashka nREPL" upgradable over a plain socket-repl

mkvlr 2020-11-09T14:42:13.210200Z

thatโ€™s what Iโ€™m talking to @borkdude about

mkvlr 2020-11-09T14:42:33.210400Z

not public yet but happy to add you to our repo, warning: also not pretty yet

seancorfield 2020-11-09T17:43:25.211200Z

@mkvlr Aren't the nREPL folks working on side-loading nREPL itself over a Socket REPL? (the way Unrepl already works)

seancorfield 2020-11-09T17:51:05.212500Z

Rich seems fairly strongly against a REPL that doesn't work as a pure streaming REPL -- which means that if you go over the wire, rather than being in-process, you have all the associated issues of large values and interruptible execution etc.

mauricio.szabo 2020-11-09T18:14:42.216400Z

@seancorfield to be honest, nREPL is streaming~ish. You can parse the payload as it comes, and newer versions of nREPL also allow you to receive evaluation results as "chunks" of string. There are strange things on nREPL, like a stdout and stderr message being associated with an evaluation ID, but I mostly ignore it

seancorfield 2020-11-09T18:51:57.217Z

https://github.com/seancorfield/vscode-clover-setup in case anyone wants to use my Chlorine Clover setup with VS Code ๐Ÿ™‚

seancorfield 2020-11-09T18:52:22.217400Z

Key bindings are identical, so are the commands.

mkvlr 2020-11-09T19:27:26.218800Z

right, it was added in 0.7 it seems https://nrepl.org/nrepl/design/middleware.html#sideloading

mkvlr 2020-11-09T19:28:12.219600Z

still think an edn-based protocol would be simpler than binary

pez 2020-11-09T19:42:08.219800Z

Oh, indeed! Hotreloading the extension and having the REPL is fantastic.

seancorfield 2020-11-09T19:43:10.220700Z

Oh, hey @pez -- I've switched to the "dark side" over the weekend, now that I can have custom tasks in VS Code so my REPL/Reveal workflow is identical to Atom ๐Ÿ™‚

pez 2020-11-09T19:48:21.223600Z

Yeah, I've been reading along and seen your joy. ๐Ÿ˜ƒ Very, very cool stuff this all!

borkdude 2020-11-09T20:26:07.223900Z

@seancorfield Did you also try clj-kondo in vscode?

borkdude 2020-11-09T20:26:28.224300Z

You can install it as an extension, you don't even need the binary installed

seancorfield 2020-11-09T20:56:12.224600Z

@borkdude Yup, and it's very nice, thank you ๐Ÿ™‚

seancorfield 2020-11-09T20:57:11.225800Z

I also have the sync settings stuff enabled between my Win/WSL setup and my Mac setup -- so I didn't even need to add any extensions on Windows: it sync'd all of them automatically from my Mac, which was pretty slick!

borkdude 2020-11-09T20:57:36.226200Z

is this the sync extension for syncing settings? I tried it but I could not figure out where it stored stuff

seancorfield 2020-11-09T20:58:28.227100Z

You sign in via either a Microsoft or GitHub account and it uses those credentials to store it in the cloud (just like browser stuff gets sync'd in Chrome/Edge/etc).

borkdude 2020-11-09T20:59:20.227400Z

where do I sign in, how?

borkdude 2020-11-09T21:02:37.227900Z

oh I see something now. this is probably new. I was trying out a third party extension a while ago which didn't work for me

seancorfield 2020-11-09T21:03:14.228600Z

Yeah, this is all built-in but with lots of caveats about reading the docs and it being experimental ๐Ÿ™‚

borkdude 2020-11-09T21:05:51.228900Z

so where does this thing store the data though?

seancorfield 2020-11-09T21:23:50.229500Z

@borkdude Somewhere on Microsoft's servers, just like the Edge settings sync.

seancorfield 2020-11-09T21:24:12.229900Z

Just like Chrome stores your settings on Google's servers.

seancorfield 2020-11-09T21:24:52.230600Z

That's kind of the whole point of sync: keeping all your devices in sync via centralized storage of the settings/data/etc.

borkdude 2020-11-09T21:40:54.231Z

it's all open source though, so I wonder where they keep the vendor-specific things. reading this now: https://github.com/microsoft/vscode/blob/master/src/vs/platform/userDataSync/common/extensionsStorageSync.ts Maybe the vendor-specific parts are in proprietary extensions

borkdude 2020-11-09T21:45:39.231600Z

Anyway, I hope this works, because I wanted this :)

mauricio.szabo 2020-11-09T22:05:28.233Z

VSCode merges the "open source part" with some private repository, so probably is not publicly available...

seancorfield 2020-11-09T22:06:37.233800Z

VS Code vs VS Codium, right? The latter is all open source, the former is Codium plus some MS proprietary stuff?

borkdude 2020-11-09T22:12:03.234400Z

The most interesting stuff, like the SSH extensions, are proprietary it seems ;) Have you tried this (the remote ssh stuff) Sean? It was really shocking to me how well it works.

mauricio.szabo 2020-11-09T22:15:02.239100Z

Yes, the VSCode is the source available on GitHub (the repository is marked as Microsoft/VSCode but the product itself is called code-oss) merge with a "mix-in repository" and some private extensions: https://github.com/microsoft/vscode/blob/6d36470eb8c12724a4de7f6cae07b9bd5007ef91/build/azure-pipelines/linux/product-build-linux.yml#L50 The codium project is a code-oss without most of the telemetry, compiled in a binary format ready to use (but without the proprietary mix-in and extensions)

seancorfield 2020-11-09T22:18:24.239800Z

@borkdude Yup, part of why I've switched to VS Code is because of the WSL2 integration. It's very slick.

seancorfield 2020-11-09T22:18:40.240100Z

(I assume that's what you're referring to?)

borkdude 2020-11-09T22:19:52.241200Z

WSL2 yes, but also when connecting to other machines, but that's similar

seancorfield 2020-11-09T22:19:55.241300Z

I have no need to work against remote servers otherwise, although I guess if I could use it to edit stuff on QA/production, that would be a bonus ๐Ÿ™‚

seancorfield 2020-11-09T22:20:31.242100Z

Most of our SSH setup assumes you go into the box as a low-priv user and then sudo -- does it support that workflow?

borkdude 2020-11-09T22:21:46.242800Z

That's something I wanted to do recently to, I logged in as root eventually which might not be so good... I need to find this out

borkdude 2020-11-09T22:22:27.243Z

Open issue: https://github.com/microsoft/vscode/issues/48659