Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Reminds me of Paredit, an emacs mode for structural code editing and navigation for lisps. It keeps the parse tree valid even as you do crazy stuff.

http://danmidwood.com/content/2014/11/21/animated-paredit.ht...



Yeah slurping and barfing in Paredit are quite similar to basic restructuring operations in tylr, eg selecting a parenthesis and moving it somewhere else. Some differences:

(1) In tylr you move the parenthesis itself, rather than making the parenthesized term slurp/barf its neighbors. This may seem like a minor difference for simple operations like this but I think it's an important primitive UI metaphor that makes the editing experience feel more direct/linear/text-like rather than you having to translate your editing goal into operations on the AST.

(2) tylr generalizes beyond S-expressions to infix operator sequences and other multi-sorted syntactic forms (eg it understands you shouldn't be able to move expression forms in patterns).

(3) tylr generalizes beyond parenthesis moving to near-arbitrary range selection moving, eg I could make the selection (specified by the square brackets)

`( 1 + 2[) * (]3 + 4 )`

and directly move it over to give

`( 1[) * (]_ + 2 + 3 + 4 )`

(where tylr has inserted a hole `_` to keep things well-formed)


Was looking for this exact comment.

I’m honestly waiting for a tree-sitter (or LSP) based paredit-mode to show up, so that I can use it for all modes and languages, and not just LISP.


Paredit is really great, and has been adapted to other editors as well. Writing Clojure in IntelliJ with Cursive and Paredit mode is really pleasant.


Smartparens is another emacs mode for structural editing as well.


Yep, Paredit was my first thought as well.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: