Fork me on GitHub
#parinfer
<
2018-03-05
>
eraserhd15:03:26

The reasons are probably not good ones, though. Just my eternal dissatisfaction with my Vim setup for Clojure.

eraserhd15:03:17

I'm maybe 1/5th of the way through the first pass, which is really just a transliteration into Rust, where types permit.

justinlee18:03:09

wait maybe i’m dense, but how did your dissatisfaction with your vim setup result in your porting parinfer to rust

eraserhd18:03:43

I have been using the nvim parinfer, and it has been working really well for me, except that I've continually have had to do a six-step manual process to get my plugins to register.

eraserhd18:03:29

This has worked... it is a work around for the fact that the node host just dies if you have more than one node plugin. It's been an open issue forever.

eraserhd18:03:21

But last time, I couldn't get it to work at all, even with manual registration. I'm kind of frustrated with that whole hosting thing.

eraserhd18:03:10

So I kind of just burned it down and went back to plain Vim. They now have a terminal, and Bram is super responsive on fixes and new features now (I don't know if there was a time when he wasn't.)

eraserhd18:03:56

So then I found oakmac's port of parinfer to VimL and started using that. It's kind of nice, except that I have to wait six or seven seconds on particularly bad files after hitting Esc to get the cursor back.

eraserhd18:03:11

So... I optimized that down to 3 or four seconds and submitted a pull request.

eraserhd18:03:38

They were talking about using the Python parinfer port if it's installed, falling back to VimL. But... I have been thinking about Vim 8's job control functions, being able to send JSON messages to an external program and get back JSON messages.

eraserhd19:03:33

But the kicker was that I once had a nice ruby plugin for C++ that kept my #include and #define's up-to-date, and namespace directives, and managed a library of stored code that it would paste in at the right spot if I called it. I used it when I used to compete at TopCoder to get the first submit on problems that were easy enough that you didn't have to find some kind of "trick".

eraserhd19:03:22

And I realized that I could add a lot of the IDE-like functionality I've wanted if I had a fast, testable, external process that opines on every edit.

eraserhd19:03:09

Automatically adding/removing requires, complete with :as, by finding what is required as what elsewhere in the project.

eraserhd19:03:21

Adding :refer-clojure when you define a name in clojure.core.

eraserhd19:03:17

etc. whew... that was long winded 😄

eraserhd19:03:26

(I've since learned about Vim's libcall(), which would allow me to send and receive JSON messages in memory, with no wire overhead.)

snoe19:03:39

parinfer.js is nice because many things can run js…but rust is maybe nicer with webasm and c targets which might cover everything (maybe even intellij / nightcode with jndi).

eraserhd19:03:17

Well, I make no claims that Rust is a good idea. I'm using it for a bag of unrelated other reasons. Mostly, I didn't want to use C again, and I've been telling myself that next time I'm tempted to use C, I'd learn Rust.

eraserhd19:03:58

I've been repeatedly pleasantly surprised at its ergonomics and design choices, though.

eraserhd19:03:49

I do wonder if there are any editors aside from Vim left that are written in C. I mean, emacs, probably, but it has elisp.

dominicm20:03:01

@eraserhd this sounds great, want to follow this!

eraserhd22:03:49

Today's progress: 27 of 73 functions converted.

shaunlebron22:03:37

i don’t know much about rust and why it is conducive to compiling to wasm, so I wonder if this could help compile to other targets

shaunlebron22:03:01

do you have a repo we can follow?