parinfer

shaunlebron 2017-06-07T07:22:00.792848Z

I made a major change to Parinfer last year and called it v2

shaunlebron 2017-06-07T07:22:43.801307Z

the change was related to how to handle an unmatched close-paren

shaunlebron 2017-06-07T07:23:50.814152Z

Chris thinks it was a mistake, and we’re having a minor debate about it here: https://github.com/oakmac/atom-parinfer/issues/76

shaunlebron 2017-06-07T07:27:13.853912Z

i’d like to hear your opinion though @cfleming @sekao @bhurlow @doglooksgood (or others)

tianshu 2017-06-07T14:22:21.318134Z

for now, leaving imbalanced state. I have to type close parens manually. before V2, I do the same. is there I missed something?

mattly 2017-06-07T16:38:25.744269Z

I agree with Chris, the expected behavior is for auto-balancing

mattly 2017-06-07T16:38:57.756565Z

maybe that's not something parinfer should be doing, maybe you should complement parinfer with an auto-close plugin

mattly 2017-06-07T16:39:56.778924Z

I mean, I use it in Emacs alongside smartparens in strict-mode and paredit

mattly 2017-06-07T16:40:25.789910Z

and anymore whenever I'm not in that environment something feels off

shaunlebron 2017-06-07T18:06:24.779616Z

thanks guys, i’ll work on an implementation so we can see how it feels

shaunlebron 2017-06-07T18:09:22.846383Z

@doglooksgood you have to type close-parens manually for both v1 and v2 in the case described. the new rules may prevent that

shaunlebron 2017-06-07T19:25:53.544354Z

wrote up a summary of the new proposal: https://github.com/shaunlebron/parinfer/issues/131

shaunlebron 2017-06-07T20:34:57.967159Z

also, going to build a formatter to help use parinfer on teams: https://github.com/shaunlebron/parinfer/issues/132

dominicm 2017-06-07T22:09:15.655160Z

Definitely make it a node script. Everyone has it now, and it's fast enough™

dominicm 2017-06-07T22:09:35.659647Z

well, except in large projects I guess. In which case java is probably better.

shaunlebron 2017-06-07T22:09:55.664157Z

@dominicm will do

dominicm 2017-06-07T22:10:22.670533Z

I have noticed that zprint is quite slow against whole files from lumo. So maybe I should take back that idea 😛

shaunlebron 2017-06-07T22:10:47.676129Z

prettier runs pretty fast, I’ll be looking how they do it

shaunlebron 2017-06-07T22:11:28.685585Z

zprint?

dominicm 2017-06-07T22:11:44.689093Z

prettier is based on a paper: http://homepages.inf.ed.ac.uk/wadler/papers/prettier/prettier.pdf no idea if the speed comes from this

shaunlebron 2017-06-07T22:12:11.695018Z

oh, i thought we were talking about node’s i/o

dominicm 2017-06-07T22:12:20.697161Z

https://github.com/kkinnear/zprint

shaunlebron 2017-06-07T22:12:28.698932Z

parinfer on node is lightning fast though

shaunlebron 2017-06-07T22:12:56.704957Z

15ms per 3k lines?

shaunlebron 2017-06-07T22:13:28.712236Z

can’t remember, but it’s fine

dominicm 2017-06-07T22:13:42.715151Z

zprint is clojurescript (on lumo). So that might be it. But it was definitely a big pause for a single file. Like ~30s or so.

shaunlebron 2017-06-07T22:14:20.723551Z

oh wow, I didn’t know about this, only heard of cljfmt

dominicm 2017-06-07T22:14:47.729580Z

I've no idea why nvim parinfer doesn't feel fast on my machine then, it's a new laptop. Maybe something misconfigured, or it's using the clojure one still

shaunlebron 2017-06-07T22:15:38.741104Z

maybe my benchmarks are off, atom-parinfer always felt fast to me, but it does limit itself to the parent expression

dominicm 2017-06-07T22:15:59.745761Z

ah, I'm not sure if nvim parinfer does that 🙂

shaunlebron 2017-06-07T22:17:42.768177Z

we’ll see, I’ll tag you for feedback when it’s ready

dominicm 2017-06-07T22:18:48.782404Z

I've got some large real world projects which will enjoy some benchmarking

shaunlebron 2017-06-07T22:49:40.162400Z

any ideas for the name of the cli command? @dominicm

dominicm 2017-06-07T22:52:40.196783Z

Hmm. Something inside me feels cheesy, but parinfmt doesn't sound terrible.

shaunlebron 2017-06-07T22:53:01.200596Z

lol

shaunlebron 2017-06-07T22:53:38.207601Z

I’d probably settle for parinfer-fmt if we’re going that direction

shaunlebron 2017-06-07T22:55:33.229521Z

or parinfer-prettify or just parinfer