3 ms·
Reminded me of https://github.com/ast-grep/ast-grep https://github.com/ast-grep/ast-grep and I wonder how it compares in performance and functionality.
by danilonc 2y ago
Reminded me of https://github.com/ast-grep/ast-grep https://github.com/ast-grep/ast-grep and I wonder how it compares in performance and functionality.
- danilonc 2y agoast-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.
- eviks 2y agoThis used the more sound approach of treating code as code
- herrington_d 2y agoast-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/9f8ed5fb2abf35d9280a05b17ed49c888f5a9aad/crates/cli/src/utils.rs#L216-L233 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)