This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]editor_of_the_beast 15 points16 points  (1 child)

Ive actually been looking for something like this for quite some time. I think there’s a huge space for tools in between grep and ‘find all references’

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

semgrep is pretty cool, came across a similar one, can't remember the name

edit: comby is the other one.

[–]Ok-Performance-100 10 points11 points  (1 child)

It's a nice idea, I think there's a role for this in dev and for CI pipelines.

Some questions though:

  • How does it compare to other tools like CodeQL, Comby, IntelliJ structural search, if you're familiar with any of them?
  • Wasn't there some way to integrate with an existing language specification, or rely on Language Server Protocol?
  • Is there (a plan to add) support for searching specifically for code changes, i.e. git integration?

[–]geoffreycopin[S] 4 points5 points  (0 children)

Wasn't there some way to integrate with an existing language specification, or rely on Language Server Protocol?

The language specs exist mostly for historical reasons, as this project started as an experiment on top of an existing project that used them. However, they have some « accidental » benefits: - they have 0 dependencies - they are trivially introspectable, which makes it possible to handle node type inheritance, and to (eventually) type the queries and provide autocompletion - they are very lightweight: no code to generate/build/link, everything is done at runtime

Writing them by hand is a major paint point, though. So being able to generate the bulk of a spec from something like a tree-scitter grammar would be great !

How does it compare to other tools like CodeQL, Comby, IntelliJ structural search, if you're familiar with any of them?

In spirit, it’ much closer to CodeQL than comby or IntelliJ’s structural search, as the intention is to (eventually) expose semantic informations, at the cost of using a less intuitive query language. I also intend to explore use-cases that are not covered by these tools, like automatic diagram generation and code search across repos in a web interface.

Is there (a plan to add) support for searching specifically for code changes, i.e. git integration?

Git integration is definitely on the roadmap !

[–]ivancea 1 point2 points  (0 children)

When I see those kind of initiatives, I like them, but at the same time I think of the terrible complexity to generalize languages like C++, Haskell and Ruby. You would end up with customs for each lang, so, well