parinfer

Drew Verlee 2019-03-07T14:37:22.013900Z

out of curiosity, does anyone have an idea why we don't have a fully working version of smart mode on emacs? Given Emacs is the mostly widely used clojure editor, i would have thought it would have gotten the most attention (due to the larger community).

eraserhd 2019-03-07T14:56:47.014500Z

I think it's because nobody has time to work on the elisp port.

eraserhd 2019-03-07T14:57:58.015900Z

However, parinfer-rust fully supports smart mode, and builds a dll which I'm told can be invoked from emacs. Not being an emacs user, I haven't done this.

eraserhd 2019-03-07T14:59:14.016900Z

(However, as the maintainer of parinfer-rust, I would certainly support those efforts.)

Drew Verlee 2019-03-07T15:14:12.022100Z

Thanks @eraserhd. It would seem vim also has a port. I fall into that category of dont have time to make it work and i'm currently looking at alternatives.

dominicm 2019-03-07T17:42:28.022600Z

Clojure developers are always busy

Chris Oakman 2019-03-07T17:49:02.023400Z

I can take some blame for this 😉 I originally wrote the elisp port and have not kept it up-to-date with parinfer.js. I don't use emacs so it's not really a pain point for me.

Chris Oakman 2019-03-07T17:50:13.025100Z

I do think there would be value in updating the port. It's always nice to have "native" integration with the editor's language of choice. I feel similarly about the Python port + Sublime Text.

Drew Verlee 2019-03-07T20:12:47.028100Z

@chrisoakman I wasn't aware of your port, i having been using https://github.com/DogLooksGood/parinfer-mode. I would love to take the dive and fix it, i'm not sure even anything is really better then smart mode parinfer honestly. Everything else requires a lot of keybindings do achieve the same effect. I'm trying to compare it to Paxedit and lispyville.

justinbarclay 2019-03-07T20:15:34.028900Z

Parinfer-mode is based off of the library from @chrisoakman 🙂, with a bunch of emacs niceties added on https://github.com/DogLooksGood/parinfer-mode/blob/master/parinferlib.el

Drew Verlee 2019-03-07T20:18:44.030200Z

mildly curious why you wrote the port to an editor you dont use. Thanks for the effort, honestly just curious what motivated you.

Drew Verlee 2019-03-07T20:19:10.030700Z

more importantly, roughly what kind of investment from a beginner would it take to update it?

justinbarclay 2019-03-07T20:24:19.032600Z

I can’t speak for @chrisoakman, but from what I remember the port of parinfer was a lot easier before hand, when it was written in a lisp like style. Some time since then the reference implementation switched to a more imperative style (I think to make it easier for other editors to implement? Or just to reason about)

justinbarclay 2019-03-07T20:34:46.035Z

I haven’t fully read through it but if you wanted smart mode you could install this package locally and (require 'parinfer-smart) instead of (require 'parinfer). From what I remember @doglooksgood got pretty far with it but ran into some bugs they didn’t have time to figure out. https://github.com/DogLooksGood/parinfer-mode/blob/smart/parinfer-smart.el

justinbarclay 2019-03-07T20:35:50.035900Z

I’ve also been kind of hankering for smartmode, which is why I’ve been paying attention. However, like you, I’ve been too busy to work on it =/

Chris Oakman 2019-03-07T20:44:52.039300Z

@drewverlee I don't have a strong answer other than I really wanted Parinfer to succeed and "I am a huge language nerd". I first did the Python port so parinfer could work in Sublime Text, then it just sort of snowballed and I ended up doing 3 more ports in like a month's time in order to reach more editors. There was a lot of momentum.

3
Chris Oakman 2019-03-07T20:45:36.040700Z

I think it could be updated to match parinfer.js. The first step would be to update the test suite.

Chris Oakman 2019-03-07T20:46:25.041900Z

I am going on a self-imposed programmer's retreat in April. Maybe I could pick it up as a project then. I feel like there is always a backlog of open source maintenance work to be done.

Drew Verlee 2019-03-07T20:50:25.044800Z

awesome! i'm glad you did. It's your time and you should use it on what makes you happy. I have gotten a lot of use out of your work already. If you start a pareon/whatever i would support it.

Chris Oakman 2019-03-07T20:51:13.045100Z

Thank you! This is very kind 😄

Chris Oakman 2019-03-07T20:50:39.045Z

It has been a little frustrating how difficult it is to integrate Smart mode with various editors. When Parinfer was just Paren and Indent mode integrations were much simpler: you did not need any information about "the change" from the editing operation. You could just debounce the onChange event and run those pure functions when it was ready.