I heard lots of great feedback about Parinfer at the Conj this year. Mostly in hallway conversations.
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.
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.
Her company hired her for Ruby, then switcher her onto a Clojure project.
@chrisoakman Right, I’m waiting on getting some bugs resolved before I push it out (v3 that is).
me: "Do you use Cursive"? her: "No, I use IntelliJ."
A couple questions later I learn that she is using Cursive, but is unaware of it.
I tried to use it for a while, but it was pretty painful without it.
Hehe, yeah, that happens.
me: "Are you using Parinfer?" her: "No - I just use whatever Cursive does."
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.
Then I explained that Cursive was on an older version, etc, etc.
But - I thought her story was very indicative of what I heard from at least 6 different people at the Conj.
Parinfer actually isn’t on by default in Cursive, so if she didn’t do anything she actually wouldn’t be using it.
Maybe one of her co-workers turned it on by default for her.
But yeah, I’m keen to get v3 out there.
Anyway - this is what she told me.
Thanks, that’s interesting - yeah, that’s likely.
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
@cfleming Are you blocked on parinfer-jvm being updated to the latest parinfer.js ?
That is definitely something I want to help facilitate if necessary. Either updating it myself or convincing someone else to do it for us 😂
@chrisoakman No, they’re actually parinfer v3 bugs: https://github.com/cursive-ide/cursive/issues/1303#issuecomment-336554960
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.
I actually have v3 implemented in a branch, but in IntelliJ v3 is currently not very usable.
When you say "v3" I assume this is what we currently call smartMode
?
Right.
Would it be helpful if parinfer-jvm were up-to-date with parinfer.js?
No, I actually have those changes merged into my version, but my internal version has diverged somewhat from parinfer-jvm.
FWIW there have been exactly zero issues opened against atom-parinfer since adding smartMode earlier this year
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)
ok
It would be nice if there were just one codebase for Parinfer on the JVM.
Absolutely, mine is still based on parinfer-jvm and could be used as the basis for a port.
I think there are a couple of issues - as smart mode gets more complex, it needs a deeper integration into the editor.
See https://github.com/shaunlebron/parinfer/pull/170 for an example.
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.
https://github.com/shaunlebron/parinfer/wiki/Problems-integrating-parinfer-into-Cursive
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.
See here for some screenshots: https://clojurians-log.clojureverse.org/parinfer/2017-08-18.html
These are all great notes.
I knew there had been some discussion about all this, but I wasn't really watching this channel during that time.
smartMode proved to be trickier to implement in atom-parinfer than indent / paren mode before
It seems to work fine, but I don't love the current implementation right now. I want to improve it.
I spoke with Ryan a bit about this during the Conj.
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.
I'm sorry you have to deal with this. It sounds like an Object Oriented Mutable State nightmare.
Well, not really - it’s actually just that IntelliJ is much more complicated than e.g. Atom.
Or - at least caused by a bunch of stateful OO code.
It’s very common in IntelliJ to perform actions (e.g. refactorings) which affect files without them ever being opened in an editor.
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.
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.
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
I think someone mentioned to me at the Conj that they sometimes had trouble with multiple cursors + atom-parinfer
Yeah, it won’t work correctly.
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.
That sounds good. I know Shaun was working on his talk for like months. Did not have much bandwidth for other things.
Yeah, I think so.
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 undo
ne (`undo` seems to lose track of the changes -- presumably because of some interaction between paredit and parinfer?).
I might just give up using paredit for a while and see what I lose 🙂
@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)
i got some negative feedback at the conj
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
and another approached me to clarify that parinfer in fact makes whitespace significant in clojure, and seemed dumbfounded at why
seems similar to the feedback here: https://www.reddit.com/r/Clojure/comments/765tfa/inspiring_a_future_clojure_editor_with_forgotten/doceve9/
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.
I'd be curious to know if Elena thought there was a particular point people are struggling with?
http://www.reddit.com/r/Clojure/comments/765tfa/-/dod4mq8 seems like some use it with beginners too.
@shaunlebron Did Elena expand on why it was difficult for them?
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”.
Actually, re-reading what you wrote perhaps you were referring to what the other person said.
she didn’t expand, but we agreed to connect later
yeah, I was referring to what the other person said
@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/
@chrisoakman I'm glad you got that cleared up
glad to hear that the conversation with Rich seems to have gone well :D
He is a fan of Parinfer. Thinks it's great work.
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
lol, Rich did not say he was a fan of Parinfer
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”
I remember him saying something like "It's great work"
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 😆 🙃
haha, /shrug
i was just happy he didn’t hate it
Yup. He definitely does not hate Parinfer.