Code rewriting tools

· rrees's blog


Fastmod uses regular expressions to search and replace code, it has a good review mode to help make sure the matches and substitutions are what you were expecting. I'm not sure it is much different from the tooling that are in editors and IDE's already.

ast-grep is an Abstract Syntax Tree grep and sed tool, it obviously has the power of being able to really understand the structure of the code compared to regular expressions but does also require a bit more understanding of the parser and replacement syntax to get the best out of it. That said the basic mode is pretty much the same as fastmod but safer due to the code parsing and with less need for a review step.