News for hackers. Stuff that matters.
Re:Amber: A code search and replace tool by danilonc on Thursday May 23, 2024 @11:21AM (#40455830)
Reminded me of https://github.com/ast-grep/ast-grep and I wonder how it compares in performance and functionality.
Re:Amber: A code search and replace tool by danilonc on Thursday May 23, 2024 @11:23AM (#40455859)
ast-grep find/replace Abstract Syntax Tree. Amber matches on regex.

It seems ast-grep is more powerful if you don't exactly know how the code is structured.

Re:Amber: A code search and replace tool by eviks on Thursday May 23, 2024 @12:10PM (#40456517)
This used the more sound approach of treating code as code
Re:Amber: A code search and replace tool by herrington_d on Thursday May 23, 2024 @05:31PM (#40460140)
ast-grep is based on tree-sitter parsers and most of the time is spent on parsing.

There is some optimization to [skip parsing](https://github.com/ast-grep/ast-grep/blob/9f8ed5fb2abf35d928...) but generally I don't expect ast-grep can beat ripgrep or amber. (but sometimes ast-grep can beat grep due to parallel processing)