Fork me on GitHub
#editors
<
2021-05-22
>
flowthing08:05:58

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.

cfleming20:05:20

Tutkain looks really nice, congratulations!

flowthing20:05:44

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

cfleming20:05:20

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

flowthing20:05:31

You can say that again, brother. 😛

cfleming20:05:40

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

flowthing20:05:56

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

cfleming20:05:04

Haha, so do I.

cfleming20:05:27

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

flowthing20:05:11

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

flowthing20:05:33

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

cfleming20:05:39

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

flowthing20:05:08

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

cfleming20:05:32

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

flowthing20:05:58

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

cfleming20:05:15

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

flowthing20:05:42

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).

cfleming20:05:19

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

cfleming20:05:31

Whatever test protocol you’re using.

flowthing20:05:04

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

flowthing20:05:47

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

flowthing20:05:36

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. 😛

cfleming20:05:04

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

cfleming20:05:26

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

flowthing20:05:39

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

flowthing20:05:56

Sure, I need sleep. Thanks!

mauricio.szabo12:05:13

Great work, @U4ZDX466T! 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.szabo12:05:53

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

3
flowthing14:05:12

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

mauricio.szabo15:05:14

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 :)

flowthing17:05:18

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

cfleming22:05:23

@U3Y18N0UC 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.