Fork me on GitHub

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


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


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


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.


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.


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.


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.)


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.


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


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.


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".


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.


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


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


etc. whew... that was long winded 😄


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


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).


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.


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


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.


@eraserhd this sounds great, want to follow this!


Today's progress: 27 of 73 functions converted.


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


do you have a repo we can follow?