Fork me on GitHub
#parinfer
<
2016-03-22
>
shaunlebron01:03:55

hey cfleming, congrats on the release simple_smile, haven’t had a chance to try it out yet sorry

shaunlebron01:03:11

what you described is by design

shaunlebron01:03:44

I played with it for a week in the demo editor when I posted it here before releasing that

shaunlebron01:03:17

i played with allowing the cursor to move right, but it was inserting a lot of spaces

cfleming01:03:24

@shaunlebron: Thanks! There’s a bunch of teething issues but nothing serious. I’m hoping to get another release out tomorrow to fix them.

shaunlebron01:03:25

err, you could press right indefinitely

shaunlebron01:03:54

so I thought it might be apparent to just press spacebar

cfleming01:03:39

Perhaps it’s just something you need to get used to - I found it pretty jarring.

shaunlebron01:03:49

|) after pressing right 5 times => |)

shaunlebron01:03:02

parinfer can be jarring

cfleming01:03:48

Yeah, I still haven’t tried it properly with real code yet.

shaunlebron01:03:48

its rules can lead to surprises, either pleasant or confusing

shaunlebron01:03:49

how I can keep track of feedback from cursive users?

shaunlebron01:03:57

just on github?

cfleming01:03:58

Yeah, there’s been some discussion on the issue tracker, and some on the mailing list too: https://cursive-ide.com/archive/1882.html

cfleming01:03:13

There are a few issues in the tracker too, I’m working through them now for the next release.

shaunlebron01:03:23

work never ends!

shaunlebron01:03:43

this cursive mailing list design looks good btw

cfleming01:03:00

Thanks, I shamelessly stole it from lobsters.

cfleming01:03:44

I’m planning to improve it, currently it’s based on the text version of the emails but I’m going to use mailgun’s API to get the stripped HTML version.

cfleming01:03:54

That should look much nicer.

cfleming01:03:13

I’m also going to replace the search with a Google custom search - DDG just doesn’t work that well.

cfleming01:03:08

It turns out that de-Googlifying my life is trickier than I thought.

shaunlebron01:03:28

just as they would have it

shaunlebron01:03:08

i’m gonna be following this mailing list then, try to answer some questions regarding parinfer core

cfleming01:03:05

Ok, sounds great.

cfleming01:03:56

Looks like I need to change my title there

shaunlebron01:03:45

how frequent is the digest version?

cfleming01:03:54

Daily, I think.

cfleming01:03:37

But it’s pretty low traffic in general - yesterday and today there have been some mails due to the release, but generally it’s a couple of mails a week.

cfleming01:03:09

There’s some interesting stuff in the parinfer tracker now.

cfleming01:03:02

I’m actually considering an auto-indent mode for Cursive for when parinfer and paredit are both off, and also for paredit.

cfleming01:03:53

I’m not sure if I should try to just make my paren mode indent correctly using Cursive’s semantic knowledge, or just have a lighter-weight thing that works ok but needs occasional full formats.

shaunlebron02:03:42

auto-indent mode?

cfleming02:03:01

Like emacs’s aggressive indent

shaunlebron02:03:14

I think people would like that

cfleming02:03:19

I thought noctuid’s comments were really interesting.

cfleming02:03:36

I need to look at some of the plugins he recommends.

shaunlebron02:03:39

his parinfer-notes repo?

cfleming02:03:11

I did look at lispy a while ago, but it didn’t seem like a huge step over paredit.

cfleming02:03:00

Based on comments, I’m getting the feeling that parinfer isn’t as intuitive for new users as I’d hoped. I’ll be very interested to hear @sekao’s comments after he runs his class.

shaunlebron02:03:46

yeah, I’m starting to think that paren mode is more intuitive

shaunlebron02:03:05

I thought about it a lot this weekend

shaunlebron02:03:34

I think auto-formatting of indentation makes sense

shaunlebron02:03:48

but there is a subtle difference between aggressive indent and paren mode

shaunlebron02:03:49

aggressive indent enforces exact indentation, and paren mode just constrains to thresholds and preserves chosen indentation when expressions shift

shaunlebron02:03:14

aggressive indentation would drive david nolen crazy for example

shaunlebron02:03:26

he uses two-space indentation for everything

sekao02:03:28

today was the first day of clojure in my class, but i always spend the first day entirely in the REPL. technically i am running parinfer in nightcode’s REPL but i won’t be able to reach conclusions until we start working in a file tomorrow

cfleming02:03:02

Right, you’d have to aggressively indent to the right place.

cfleming02:03:04

I’m actually thinking about just trying to maintain indentation in the current form when typing, which will work up to a point, and then having a “format top level form” which will clean the whole form up correctly.

sekao02:03:05

regarding the intuitiveness of paren vs indent mode, the reason i’m on the indent mode bandwagon is because i think manually managing indentation comes more naturally than manually managing parens and other delimiters.

sekao02:03:08

when teaching Java, i never have to teach people how to indent properly when the scope changes — they just get it. but when it comes to delimiters, they often would accidentally forget to copy a closing brace when moving code around.

sekao02:03:18

indentation is very visually apparent, while delimiters are subtle and easy to overlook

cfleming02:03:40

That makes sense to me intuitively.

cfleming02:03:53

However I’m not sure it’s being borne out in practice.

cfleming03:03:07

Needs more investigation though, and probably more time.

shaunlebron03:03:49

the problem is that Lisp is cubist, if that makes sense

shaunlebron03:03:12

you’re essentially shown two different perspectives, and you’re forced to reconcile one when the other changes

shaunlebron03:03:29

indentation is intuitive when you see it on its own, but parens create a kind of noise around it that creates hesitation I think

shaunlebron03:03:48

this is exacerbated by the fact that a multi-line expression can start in the middle of a line

shaunlebron03:03:02

that’s not a problem in python, but since it’s possible in lisp, it creates fragile indentation points

shaunlebron03:03:50

fragile in the sense that changing text before the expression can necessitate reindenting of several lines

sekao03:03:17

i wonder if that hesitation comes from those who have already edited lisp using traditional modes and are experiencing something contrary to their expectations. my students haven’t edited any lisp at all, so i’m curious if they will just learn to “trust the indentation”

sekao03:03:03

the latter point is certainly true. hopefully they will be able to manually re-indent in that situation

shaunlebron03:03:22

i have not had an environment for user-testing, so I’m really looking forward to hearing about reactions from new users

shaunlebron03:03:55

it’s not just manually reindenting that is the problem

shaunlebron03:03:43

the most troubling thing about indent mode since the quote bug is the unmatched close paren behavior

shaunlebron03:03:53

insert [ at (foo|) bar => (foo [ bar])

sekao03:03:04

i see, haven’t seen that one before

shaunlebron03:03:41

parinfer indiscriminately removes unmatched close-parens, which is the problem there. but I’m revisiting that right now

shaunlebron04:03:46

I think I’m gonna have to delete the “Paredit emerges" section on the website

shaunlebron04:03:17

i feel like andrew wiles after someone found a mistake in his theorem… gonna have to backpedal a bit

cfleming04:03:23

@shaunlebron: This is also not behaving as I expected:

cfleming04:03:28

(defn close-paren-and-newline [editor caret context]
  (close-and-newline editor \))

cfleming04:03:51

In the Cursive implementation, that originally had another closing paren - paren mode removed it.

cfleming05:03:04

Actually, I lie - this happens in the reference impl too. It’s not paren mode that removes it, it’s indent mode.

cfleming05:03:41

Copy that text with an extra close paren, and put it in the reference impl in paren mode.

cfleming05:03:54

Then switch to Indent mode, the last closing paren is removed.

cfleming05:03:09

Then switch back to paren mode, and it complains about unbalanced parens.

cfleming05:03:36

Actually, I’ll file a bug about this.

shaunlebron13:03:36

(me right now)

snoe14:03:34

Ah that might explain my regex of #"//" getting rewritten to #"\/\/" it happens rarely enough that I haven't been able to track down the source... Maybe not

snoe14:03:40

I've personally gone to an aggressive indent style of wrangling code. I think that lisp will always require thinking in trees in some capacity, yet indent mode becomes an imperfect proxy for that thinking. Aggressive indent makes the structure more apparent through indentation but structure is directly determined and executed by the parens.

snoe14:03:38

As far as paren mode vs aggressive; we use the emacs standard indentation, so if I'm writing code and the indentation of my form doesn't match the code around it, I have more trouble reading it. I'm constantly reindenting to match code style and confirming that the shape I built matches the shape in my head/shapes around it.

snoe14:03:42

I think it would be hard (and wrong) to force a team all to use the same editor and plugins so some sort of style and indent rules need to exist to write code in a team.

chrisoakman14:03:57

@sekao: "hesitation comes from those who have already edited lisp using traditional modes and are experiencing something contrary to their expectations" --> I agree with this so much

chrisoakman15:03:18

Has this been posted to the channel yet? https://github.com/noctuid/parinfer-notes

chrisoakman15:03:30

So much in there that I disagree with; I might have to write a commentary on it. I suspect that's the same guy who posts in every reddit thread about Parinfer about how it's so inferior to Emacs + plugins.

chrisoakman15:03:52

Meanwhile, beginners believe that Parinfer is "pure magic": https://twitter.com/SoftwareWarlock/status/710895116232364036

chrisoakman15:03:29

People have stockholm syndrome with their tools

sekao16:03:05

@shaunlebron: if it makes you feel better, today’s class was a big success. my last class was pandemonium by day 2 of clojure, when i was using unassisted and paredit mode with my students. after every line i had to fix unbalanced parens or remind them how to splice with paredit.

sekao16:03:08

today i just told them to forget about the parens and focus on indentation. there were only two times the whole lecture that a student had a bug related to misplaced parens, and i was able to show both of them that they could fix it by simply fixing the indentation. the rest of the issues were just stupid nightcode bugs 😃

sekao16:03:47

i’ll keep updating you as we go along of course. i’m doing two weeks of clojure so there will be plenty of time to observe how it goes

chrisoakman19:03:31

that is huge feedback @sekao

chrisoakman19:03:47

thanks for the real-world report

cfleming21:03:01

I agree with him that the understanding of how parinfer works required in order to use it accurately is greater than I hoped.

cfleming21:03:17

Although @sekao’s feedback is encouraging.

cfleming21:03:58

I haven’t used it enough to be sure, but I’m starting to feel like some sort of auto-indent like paren mode might be the solution.

cfleming21:03:35

And I definitely agree that I think there’s some kind of hybrid mode in there somewhere, but I’m not clear what it looks like. I don’t think that switching modes is ideal.

sekao23:03:52

@cfleming: the few downsides and edge cases of parinfer have so far not bothered me because the alternatives have downsides too. nothing is perfect. with no structured mode, you get unbalanced parens, and with paredit mode, you get bewilderment. those problems don’t show up easily in a cute gif but are painful for beginners nonetheless

sekao23:03:10

besides, i wonder if renaming symbols should be treated in a special way by the ide 😉

cfleming23:03:22

@sekao: That’s an interesting point. Imagine that the user, using some hypothetical magic IDE that could actually rename symbols, renamed m to my-map from a usage in some other part of the document.

cfleming23:03:35

In that case, their definition will break, and they won’t notice.

cfleming23:03:50

That really sucks.