Hacker News new | ask | show | jobs
by chrisoakman 3878 days ago
Hi folks -- I've been working with Shaun on the tail end of this project.

Have an early prototype of Parinfer working with the Atom editor here: https://github.com/oakmac/atom-parinfer

It's pretty early software, but feedback appreciated :)

3 comments

Parinfer + Atom -- what a dream come true. Awesome work. (Edit: just took it for a spin, and it "just works", even with atom-vim -- doubly awesome. I really feel like having to navigate parens while learning the language was such a barrier to diving in to ClojureScript. Cant wait to get started.)
This comment makes me so happy; thank you :)

I'm glad it "just works"!

Your project seriously makes me want to learn lisp.
Me too!

And I already wanted to learn Lisp. Because I kind of half-assumed this tool to be there already :-P

I always assumed, obviously Lisp didn't get this popular if people had to keep track of all their parentheses. Sure they probably had to in "the old days" (although I wonder even when?). It just seems like a tedious thing to have to do in order to work with such a consistently structured language.

Of course you can get most of it with highlighting matching parens and auto-formatting shortcuts. Like most languages.

But I kind of expected Lisp tooling to go the extra mile. Because it is that structured.

From my limited knowledge of Lisp, I figured some vague ideas on how such a tool would work / should be designed. It's kind of cool to see that the author's initial steps match up with that idea: define a grammar, some invariants, and "have at it" (ok, so I didn't figure that far). And then he made it work!

Maybe a silly question, but since the author is in this thread: Was it hard to make? :-)

BTW the idea of switching between these two modes is a very clever approach to keeping certain invariants invariant while still being able to modify the code--because the trivial way to preserve the invariant would be the tool immediately reverting your edit :)

I can't thank you enough for this! It's just awesome! I really enjoy learning Clojure / ClojureScript and with Parinfer it will be even more fun! Thanks
Wow. Could it also work with JavaScript?
Not really due to the fundamental difference between Lisp and JavaScript syntax.

You could borrow the idea of indentation inferring function scope structure and make a plugin that would modify JavaScript syntax accordingly, but I'm not sure that would even be desirable when writing JavaScript.

Parinfer is made possible by Lisp's unique syntax.

Check out Kent Beckman's Prune for ideas along this line: https://www.facebook.com/notes/kent-beck/prune-a-code-editor.... It's not quite the same since it's more like an enforced paredit, but it contains a lot of similar ideas and also enforces indentation.