Show HN: Grasp – grep Clojure code using clojure.spec regexes
github.com
github.com
What is your motivation for making this? Refactoring? Code Indexing, if so for academic analysis, defect detection or ?
I could see this being a really nifty search interface for massive code libraries.
Are you discussing this library on another Clojure communication channel (Discord, Slack, etc) and if so, where?
The reason I wanted to know more about this specific pattern is to answer the question if it's relevant enough for scripting. If so, I should probably support that in my Clojure interpreter (https://github.com/borkdude/sci) which is used in babashka (https://github.com/borkdude/babashka), a fast starting scripting environment for Clojure.
After seeing Grape (https://github.com/bfontaine/grape) I connected the dots and figured I could do this using clojure.spec.
I usually hang out on Clojurians Slack (channels: babashka, sci, clj-kondo, clojure, off-topic).
Happy to see this shipped. In 2018 I Tweeted about searching Clojure code with Spec: https://twitter.com/PetrusTheron/status/963372454172418048
I know the owner of that repo and I'll refer him to your question since he can answer this better than I can.
it's unclear to me what exactly they rely on in tree-sitter grammars so it's hard to say whether tree-sitter-clojure would be helpful for them. i think tree-sitter-clojure does what it does pretty well based on testing across a large number of code files from clojars and recent generative testing runs. however, it deliberately does not try to do certain things (e.g. identify definitions, special forms, etc.) for various reasons. the approach is very similar to that of rewrite-clj* and parcera.
I was thinking of doing something similar for a RISC-V cpu, where the CPU would generate compressed histograms of common multiple instruction sequences (across loop boundaries) so that one would know what super instructions to synthesize.