parinfer

snoe 2018-03-14T04:09:16.000093Z

@eraserhd go for it.

misha 2018-03-14T11:14:06.000294Z

@shaunlebron can barely move cursor in parinfer-codemirror in ~300 lines of pretty printed 2-3 level deep map :( it looks like it is being called on cursor move rather than on text change.

misha 2018-03-14T11:15:28.000385Z

any mode, the latest cljsjs parinfer and codemirror

misha 2018-03-14T11:17:56.000094Z

actual editing stutters even on 2 short lines.

eraserhd 2018-03-14T14:46:28.000539Z

Successfully called the function from Vim!

🦜 2
eraserhd 2018-03-14T15:34:33.000655Z

And, it works. Rudimentary README with installation instructions for Vim. https://github.com/eraserhd/parinfer-rust

👍 3
eraserhd 2018-03-14T15:35:56.000189Z

It seems to have trouble with some files. This might be errors in my porting. I'll be dogfooding from now on 🙂

eraserhd 2018-03-14T16:06:08.000064Z

Ah, it has trouble with unicode characters.

eraserhd 2018-03-14T16:48:27.000092Z

There are some unhandled corner cases with unicode characters, but with the last commit, it works.

eraserhd 2018-03-14T19:12:52.000196Z

Hey, so I optimized the Vimscript a bit, and now the file which was failing, which is the worst file I have to deal with, responds as fast as any other Vim command. Feels like there's no penalty for running it.

justinlee 2018-03-14T19:16:30.000513Z

okay next step is to compile it to wasm and see if it is faster than the native atom version 😛

🤯 1
justinlee 2018-03-14T19:17:03.000347Z

for the true ouroboros experience

justinbarclay 2018-03-14T19:17:14.000647Z

Well I mean thats the second step, the first one is getting it working in Emacs <_<;

eraserhd 2018-03-14T19:29:35.000339Z

I have no clue how emacs plugins work; however, I would welcome emacs glue code in that repo if it's useful.

eraserhd 2018-03-14T19:31:01.000380Z

ha, I guess I still have emacs installed. I used to use it for Proof General.

dominicm 2018-03-14T21:25:17.000270Z

And then we can run the wasm on neovim-node

dominicm 2018-03-14T21:25:46.000052Z

Then we can run that inside project Detroit...

snoe 2018-03-14T21:26:03.000406Z

@eraserhd what version of rust did you target?

eraserhd 2018-03-14T21:28:34.000169Z

I think I just installed it last week. I didn't look at the version. I didn't use anything unstable.

snoe 2018-03-14T21:29:02.000542Z

k, I was still on some 1.19 version, just updated to lastest stable and it built

eraserhd 2018-03-14T21:29:12.000622Z

Oh, it just occurred to me that it makes the assumption that dynamic libraries end in dylib.

snoe 2018-03-14T21:34:21.000561Z

it works great! Still laggy around the bottom of clojure/core.clj but obviously that’s worse case.

snoe 2018-03-14T21:36:27.000532Z

I think in the early days @chrisoakman might have made an edit to the official lib for atom that assumes the start of a sexp is on the first column.

eraserhd 2018-03-14T21:52:34.000362Z

I saw that on the vim-parinfer plugin, but it messed me up in a file with a multi-line string that continued in column 1.

dominicm 2018-03-14T22:11:29.000040Z

@snoe I think, while that's still in place, it's not considered to have a noticeable effect, given how fast parinfer is.

dominicm 2018-03-14T22:12:51.000294Z

Are there benchmarks for those using other parinfer implementations with clojure/core.clj? I would expect rust to be one of the fastest. I'd be more inclined to blame slow read from the buffer than anything.

dominicm 2018-03-14T22:13:25.000495Z

There is something in neovim about being sent diffs of a buffer... If read is the issue, that could be a solution.

eraserhd 2018-03-14T22:19:04.000217Z

I suspect the best indifferent there would be caching the state in a line by line basis and restarting fun the first changed line.

eraserhd 2018-03-14T22:21:33.000011Z

Oh. I guess yeah, buffer read.

snoe 2018-03-14T22:21:55.000071Z

we had some timing logs in nvim-parinfer but this might be the only captured timings. Within the cljs code we were running 5-8 ms on parinfer 1.6.1 https://gist.github.com/djwhitt/81f99794aa0c35b521f6

snoe 2018-03-14T22:22:10.000347Z

“small/medium” file