Fork me on GitHub
#parinfer
<
2017-10-16
>
chrisoakman01:10:01

I heard lots of great feedback about Parinfer at the Conj this year. Mostly in hallway conversations.

chrisoakman01:10:51

The most common "negative" thing I heard was that Cursive users do not think they are using Parinfer since it wasn't the same thing that Shaun demoed in Atom during his talk.

chrisoakman01:10:34

I spoke with one woman who's story was really indicative of feedback I heard from other people. She was new to Clojure, primary from a Ruby background.

chrisoakman01:10:44

Her company hired her for Ruby, then switcher her onto a Clojure project.

cfleming01:10:51

@chrisoakman Right, I’m waiting on getting some bugs resolved before I push it out (v3 that is).

chrisoakman01:10:59

me: "Do you use Cursive"? her: "No, I use IntelliJ."

chrisoakman01:10:13

A couple questions later I learn that she is using Cursive, but is unaware of it.

cfleming01:10:16

I tried to use it for a while, but it was pretty painful without it.

cfleming01:10:22

Hehe, yeah, that happens.

chrisoakman01:10:32

me: "Are you using Parinfer?" her: "No - I just use whatever Cursive does."

chrisoakman01:10:21

I then told her that she was in fact using Parinfer. And she was very adamant that she was in fact not using Parinfer because it was not what she had seen during Shaun's demo.

chrisoakman01:10:40

Then I explained that Cursive was on an older version, etc, etc.

chrisoakman01:10:56

But - I thought her story was very indicative of what I heard from at least 6 different people at the Conj.

cfleming01:10:00

Parinfer actually isn’t on by default in Cursive, so if she didn’t do anything she actually wouldn’t be using it.

chrisoakman01:10:16

Maybe one of her co-workers turned it on by default for her.

cfleming01:10:22

But yeah, I’m keen to get v3 out there.

chrisoakman01:10:24

Anyway - this is what she told me.

cfleming01:10:38

Thanks, that’s interesting - yeah, that’s likely.

chrisoakman01:10:35

I don't think there's anything particularly wrong if people are unaware they are using Parinfer. In fact, that's arguably a design goal. "It just always works that way." is a great thing IMO

chrisoakman01:10:03

@cfleming Are you blocked on parinfer-jvm being updated to the latest parinfer.js ?

chrisoakman01:10:51

That is definitely something I want to help facilitate if necessary. Either updating it myself or convincing someone else to do it for us 😂

cfleming01:10:46

I assume they’re also present in Atom, but IntelliJ likes to reformat code a lot, which creates overlapping changes that v3 doesn’t handle well yet.

cfleming01:10:38

I actually have v3 implemented in a branch, but in IntelliJ v3 is currently not very usable.

chrisoakman01:10:23

When you say "v3" I assume this is what we currently call smartMode ?

chrisoakman01:10:39

Would it be helpful if parinfer-jvm were up-to-date with parinfer.js?

cfleming01:10:15

No, I actually have those changes merged into my version, but my internal version has diverged somewhat from parinfer-jvm.

chrisoakman01:10:42

FWIW there have been exactly zero issues opened against atom-parinfer since adding smartMode earlier this year

cfleming01:10:05

I wanted to make the code as simple as possible to minimise porting bugs, so I removed any functionality I wasn’t actually using (i.e. had already been implemented in Cursive elsewhere, like tab stops)

chrisoakman01:10:00

It would be nice if there were just one codebase for Parinfer on the JVM.

cfleming01:10:02

Absolutely, mine is still based on parinfer-jvm and could be used as the basis for a port.

cfleming01:10:28

I think there are a couple of issues - as smart mode gets more complex, it needs a deeper integration into the editor.

cfleming01:10:06

I wrote a wall of text about why this was required, but I can’t find it now, I thought it was in an issue.

cfleming01:10:29

That one there is about why I can’t run paren mode before indent/smart mode. I have a good solution for this, which marks inconsistent indentation in the editor and lets the user fix it rather than trying to fix it automatically.

chrisoakman01:10:50

These are all great notes.

chrisoakman01:10:24

I knew there had been some discussion about all this, but I wasn't really watching this channel during that time.

chrisoakman01:10:51

smartMode proved to be trickier to implement in atom-parinfer than indent / paren mode before

chrisoakman01:10:14

It seems to work fine, but I don't love the current implementation right now. I want to improve it.

chrisoakman01:10:45

I spoke with Ryan a bit about this during the Conj.

cfleming01:10:02

It’s a hard balance - as smart mode gets more complex, I think it will need more information from the editor to provide more context to the changes that the user has made.

chrisoakman01:10:20

I'm sorry you have to deal with this. It sounds like an Object Oriented Mutable State nightmare.

cfleming01:10:47

Well, not really - it’s actually just that IntelliJ is much more complicated than e.g. Atom.

chrisoakman01:10:47

Or - at least caused by a bunch of stateful OO code.

cfleming01:10:17

It’s very common in IntelliJ to perform actions (e.g. refactorings) which affect files without them ever being opened in an editor.

cfleming01:10:21

And also actions which cause multiple edits in complicated patterns. I suspect that the Atom version would suffer the same bugs if users were using the paredit commands with parinfer, which I do.

cfleming01:10:32

At least for some of those bugs. IntelliJ also has a more complex mapping of carets to editors, so the Cursive version now handles multiple cursors correctly.

cfleming01:10:25

See here for another case which requires extra holding locations which aren’t actually carets: https://clojurians-log.clojureverse.org/parinfer/2017-08-30.html

chrisoakman01:10:41

I think someone mentioned to me at the Conj that they sometimes had trouble with multiple cursors + atom-parinfer

cfleming01:10:57

Yeah, it won’t work correctly.

cfleming01:10:43

It’s not too hard to fix, though, I have the fix here - we’ll need to sort out which of all these modifications I’ve made should go back into parinfer mainline, and in which order.

chrisoakman02:10:53

That sounds good. I know Shaun was working on his talk for like months. Did not have much bandwidth for other things.

cfleming02:10:08

Yeah, I think so.

seancorfield02:10:44

I think the only area where I see problems with smart mode in Atom is when I use paredit slurp/barf. If I remember to switch to paren mode first, it's fine. And mostly smart mode is fine with slurp/barf. Just sometimes it messes up the code (changes the paren structure). And it does it in a way that can't be undone (`undo` seems to lose track of the changes -- presumably because of some interaction between paredit and parinfer?).

seancorfield02:10:10

I might just give up using paredit for a while and see what I lose 🙂

cfleming03:10:35

@seancorfield Right, it tends to mess up when using operations which cause multiple edits. Wrapping is also bad (see https://github.com/shaunlebron/parinfer/issues/176)

shaunlebron05:10:00

i got some negative feedback at the conj

shaunlebron05:10:58

elena approached me and told me parinfer seemed to be a tool for experts, saying that parinfer in nightcode was a disaster for her students

shaunlebron05:10:22

and another approached me to clarify that parinfer in fact makes whitespace significant in clojure, and seemed dumbfounded at why

dominicm06:10:40

I can't help but feel like the whitespace is simply wrong. Parinfer makes the code balance with how it looks. Unless you're writing code that's just really badly indented. I'm wondering if some are going to interpret Rich's comment to be about parinfer.

dominicm06:10:04

I'd be curious to know if Elena thought there was a particular point people are struggling with?

cfleming06:10:41

@shaunlebron Did Elena expand on why it was difficult for them?

cfleming06:10:40

I’m not sure I agree that what Elena is saying is similar to that Reddit subthread. That seems to be more along the lines of “people should just harden up and learn paredit”.

cfleming06:10:54

Actually, re-reading what you wrote perhaps you were referring to what the other person said.

shaunlebron07:10:45

she didn’t expand, but we agreed to connect later

shaunlebron07:10:53

yeah, I was referring to what the other person said

chrisoakman14:10:42

@dominicm "I'm wondering if some are going to interpret Rich's comment to be about parinfer." --> reddit thread asking this question where I commented: https://www.reddit.com/r/Clojure/comments/75yc7c/opening_keynote_rich_hickey/doc3r2t/

dominicm14:10:45

@chrisoakman I'm glad you got that cleared up

rgdelato14:10:30

glad to hear that the conversation with Rich seems to have gone well :D

chrisoakman14:10:59

He is a fan of Parinfer. Thinks it's great work.

rgdelato14:10:50

also, I don't know that I would put too much stock in comments from power users on Reddit, particularly those who are already accustomed to using key commands for everything

shaunlebron14:10:25

lol, Rich did not say he was a fan of Parinfer

shaunlebron14:10:44

he said he was looking forward to the history part of the talk, and that he wasn’t talking about Parinfer when he said “par-whatever… it’s a terrible idea”

chrisoakman15:10:46

I remember him saying something like "It's great work"

chrisoakman15:10:02

On a totally unrelated, meta note: this is a perfect example of how human communication is difficult. We were literally in the same conversation and remember different things 😆 🙃

shaunlebron15:10:09

i was just happy he didn’t hate it

chrisoakman15:10:40

Yup. He definitely does not hate Parinfer.