-
-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] please rename sg to ag (sg is now used in semgrep) #778
Comments
Hi Padioleau, thank you for dropping a comment on ast-grep! We appreciate your feedback and understand your concerns regarding the The release timing of our Additionally, the To address potential conflicts and ensure a smooth user experience, maintaining both the full ast-grep command and the sg alias offers a balanced solution. This approach aligns with existing usage within ast-grep and minimizes the risk of confusion with other projects. |
And what 's' stands for in sg in ast-grep ??? |
Thank you for your comment on ast-grep. I am glad to hear from you and I value your input.
The Indeed, ast-grep does not have semantic features like taint-analysis or constant propagation. And it is not designed to do so.
I appreciate your interest in ast-grep and I would like to explain how it differs from semgrep. While both tools use abstract syntax trees to analyze code, they have different goals and features. As previously explained elsewhere[1] [2], ast-grep offers unique capabilities (like a CSS selector-like rule) and caters to different user needs (refactoring and searching). [1] https://news.ycombinator.com/item?id=38594457
I am sorry to hear that you find the name sg insulting. That was never my intention. The name sg was chosen to reflect the syntax-based approach of ast-grep and it has been used consistently since the first release in October 2022. While I hold great admiration for the semgrep project and its author, the adoption of a later naming scheme shouldn't automatically restrict earlier names, would you agree? :) |
As the semgrep author, I made the request; Of course you're free to ignore it. I think it's confusing to have a tool called ast-grep, which is clone of semgrep, and which uses 'sg' for its shortcut, while the tool is actually called ast-grep ... now if you don't see the obvious, there's not much I can do. |
Thank you for your reply again, and I value your input!
ast-grep was designed to be fast and can be used frequently on command line as This was how I came up with the short name:
I chose sg after considering several alternatives and finding it the most suitable for ast-grep.
ast-grep is inspired by semgrep, but it has many unique features that distinguish it from semgrep.
ast-grep doesn't have semantic features like semgrep. But it deserves the name of syntax-grep. I would be happy if you have time and can take a look at ast-grep's documentation site! As a quick spoiler, ast-grep can easily match Python generator expression, while, to my best knowledge, it is challenging to do so in semgrep.
It is not a shame to acknowledge ast-grep is inspired by semgrep. I have paid respects multiple times in the doc. That said, I don't think it is confusing for users to misunderstand sg with semgrep/ast-grep. There are tons of similar projects on the internet where syntax-aware searching have similar names. Indeed, we already have predecessors like Thank you again for your reply and your interest in ast-grep. I hope this clarifies some of the questions and concerns you had. And I hope, if possible, the documentation site can pique your interest about its uniqueness! :) |
Ok, I'll close then. |
both are wrong. both when users want alias names, they should learn to use their shell alias sg=ast-grep edit: more nitpickery: tree-sitter is a CST parser |
The semgrep program now includes a shortcut called 'sg' https://github.com/semgrep/semgrep/tree/develop/cli/bin
for semgrep, so it would be better to rename your 'sg' to 'ag'.
⏯ Playground Link
Playground link with relevant code
💻 Code
Code:
Pattern:
🙁 Actual behavior
🙂 Expected behavior
The text was updated successfully, but these errors were encountered: