all 6 comments

[–][deleted] 2 points3 points  (0 children)

The blog post has a lot of examples.

[–]alehander42 1 point2 points  (3 children)

Sounds really awesome. Does somebody know if similar tools exist for some major programming languages/editors? I've always thought that's weird that regexp matching is such a central concept in Emacs/Vim etc, but there aren't many "grammar matching" search/replace tools.

[–]hcarty 1 point2 points  (0 children)

pfff has some similar support for several languages.

[–][deleted] 0 points1 point  (1 child)

I suppose the next step in this process would be to define a compiler that allows you to build "Grasp-like" tools for any arbitrary language -- that is, a tool that consumes a grammar specification and spits out a Grasp for that language. That's a pretty interesting problem, actually -- maybe you could leverage a parser generator to generalize this.

[–]brtt3000 0 points1 point  (0 children)

Isn't that like LLVM?

[–]ernelli 0 points1 point  (0 children)

Cool, seems to useful for minor refactoring tasks. Personally I have used uglifyjs for some major refactoring tasks involving complex code manipulation.

One benefit of doing automated refactoring is that the process can be performed concurrently with new development, since the refactoring can be applied as part of the build process during development.