editors

Discussion about all editors used for Clojure/ClojureScript
flowthing 2021-05-22T08:50:58.014600Z

I've been working on Tutkain, a Sublime Text package for interactive Clojure development, for the past year and a half. Now that Sublime Text 4 (https://www.sublimetext.com) is out, if you're interested, you can try it out without having to buy a license. Tutkain's website (replete with incomplete documentation) is here: https://tutkain.flowthing.me/ You can use Tutkain to connect to a Clojure, shadow-cljs, or Babashka socket REPL and evaluate code from the editor. Tutkain has support for auto-completion and looking up function and spec-naming keyword information. It also sports a vaguely Cursive-like clojure.test integration. Tutkain is more like Clover, Chlorine, or inf-clojure than Calva or CIDER. It has zero dependencies on both the client (the Sublime Text package) and the server (the Clojure, ClojureScript or Babashka runtime). It uses different channels for evaluations and editor tooling, which means it won't get in your way if you want to do things like start nested REPLs. In general, Tutkain is heavily REPL-oriented. My hope is that you can use it to come up with ways to use the REPL to maximum effect, instead of having to implement bespoke capabilities into Tutkain itself for every imaginable use case. Note that Tutkain is still in alpha, so breaking changes are possible. If you end up trying it out, I'd really appreciate it if you could let me know how it goes. Tutkain (unsurprisingly) hasn't had a lot of users so far, so I could really use another set of eyes on it to iron out the bugs.

mauricio.szabo 2021-05-23T12:47:13.020300Z

Great work, @flowthing! Indeed, by being REPL-oriented it really seems closer to Chlorine and Clover. Great to see more push on trying to use REPL to the maximum effect too 🙂

mauricio.szabo 2021-05-23T12:47:53.020500Z

BTW, @cfleming, I've been using nubank/matcher-combinators for tests, and it's really sweet for the thing you described (if I undestood correctly 😄)

1➕
flowthing 2021-05-23T14:07:12.023600Z

@mauricio.szabo Thank you! Chlorine/Clover has certainly been an inspiration. 🙂

mauricio.szabo 2021-05-23T15:04:14.023900Z

It's sad that sublime does not support js for plug-ins, otherwise we could reuse the same base library for this plug-in also :)

flowthing 2021-05-23T17:11:18.024700Z

Heh, I probably would've insisted on writing my own thing anyway. 🙂

cfleming 2021-05-23T22:20:23.024900Z

@mauricio.szabo No, it’s more how to show a visual diff of two data structures that’s the problem. At some point I’m going to build something with https://github.com/juji-io/editscript but I haven’t managed it yet. Cursive’s currently works ok but uses a lot of space.

cfleming 2021-05-22T20:44:20.014800Z

Tutkain looks really nice, congratulations!

flowthing 2021-05-22T20:47:44.015Z

Thanks, Colin! And thanks also for Cursive, which I used for many years before embarking on this fool's errand. 🙂

cfleming 2021-05-22T20:48:20.015200Z

I think everyone (including me) underestimates the amount of work in making an editor 🙂

flowthing 2021-05-22T20:48:31.015400Z

You can say that again, brother. 😛

cfleming 2021-05-22T20:48:40.015600Z

I’m curious, how do you diff the test results? What does that look like?

flowthing 2021-05-22T20:48:56.015800Z

I constantly feel like I've bitten off way more than I can chew.

cfleming 2021-05-22T20:49:04.016Z

Haha, so do I.

cfleming 2021-05-22T20:49:27.016200Z

I could probably keep a team of 4 busy for a year on Cursive with no problems.

flowthing 2021-05-22T20:50:11.016400Z

I have no doubt. I sometimes feel I could almost do that with Tutkain, and it has a fraction of the features. 😛

flowthing 2021-05-22T20:50:33.016600Z

The clojure.test integration is this really dumb thing at the moment: https://github.com/eerohele/Tutkain/blob/master/clojure/src/tutkain/test.clj

cfleming 2021-05-22T20:50:39.016800Z

Last I heard (several years ago now) PyCharm has a team of 16 (!)

flowthing 2021-05-22T20:51:08.017200Z

Dear god. Well, that relieves me of some of my inferiority complex. 😛

cfleming 2021-05-22T20:51:32.017400Z

Of course, they sell like 500k licences or something.

flowthing 2021-05-22T20:51:58.017600Z

The diffing itself uses ST's built-in diff thing, so it's not very good when the results get medium-to-large.

cfleming 2021-05-22T20:52:15.017800Z

I see, you’re using pprint. The issue I always have is how to format the data structures so the diff makes sense.

flowthing 2021-05-22T20:53:42.018Z

Yes, could probably try to come up with something more clever for that. I'm not sure I want to put in a lot of effort to the clojure.test integration, though. I guess I'm considering going for a more REPL-oriented approach (Stu's transcriptor lib and that kind of thing).

cfleming 2021-05-22T20:54:19.018200Z

Yeah, fair enough. I still think you’ll want diffs when things don’t match what you expected, though.

cfleming 2021-05-22T20:54:31.018400Z

Whatever test protocol you’re using.

flowthing 2021-05-22T20:55:04.018600Z

Yeah, definitely. I'm thinking folks can then either use clojure.data/diff or something like deep-diff2 if they want to, though.

flowthing 2021-05-22T20:56:47.018800Z

Maybe first use get-in and select-keys to prune things down etc.

flowthing 2021-05-22T20:57:36.019Z

Which is to say: I'm copping out because I don't think I'm smart enough to come up with a really good diffing solution myself. 😛

cfleming 2021-05-22T20:58:04.019200Z

Haha, that’s something I’m still struggling with, which is why I asked 🙂

cfleming 2021-05-22T20:58:26.019400Z

Ok, I’d better go, my daughter needs breakfast. Congrats again!

flowthing 2021-05-22T20:58:39.019600Z

Hehe, well, for what it's worth, I always thought the test result diffing was one of the best parts of Cursive. 🙂

flowthing 2021-05-22T20:58:56.019800Z

Sure, I need sleep. Thanks!