This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-14
Channels
- # ai (3)
- # babashka (45)
- # beginners (81)
- # biff (26)
- # calva (10)
- # cider (5)
- # clj-kondo (55)
- # cljfx (6)
- # clojure (125)
- # clojure-berlin (1)
- # clojure-europe (37)
- # clojure-italy (7)
- # clojure-nl (3)
- # clojure-norway (79)
- # clojure-uk (1)
- # clojurescript (63)
- # clojutre (1)
- # conjure (5)
- # cursive (37)
- # data-science (1)
- # datalevin (4)
- # datomic (28)
- # eastwood (6)
- # fulcro (26)
- # graphql (20)
- # honeysql (6)
- # humbleui (4)
- # jobs-discuss (5)
- # kaocha (1)
- # leiningen (8)
- # missionary (5)
- # nbb (4)
- # observability (3)
- # off-topic (7)
- # pathom (8)
- # podcasts-discuss (1)
- # rewrite-clj (18)
- # ring (6)
- # sci (23)
- # scittle (9)
- # shadow-cljs (49)
- # squint (10)
- # testing (11)
- # xtdb (17)
I’m thinking about writing a pattern matching library for rewrite-clj nodes. Is this something others would use?
Interesting! So find me all the things that match <some pattern>. And maybe also optionally replace? Have you worked out what <some pattern> might look like?
My inspiration is Rubocop’s https://docs.rubocop.org/rubocop-ast/node_pattern.html, so I’m going to explore a Clojure-styled version
My mind drifted to https://github.com/lambdaisland/regal and its high level syntax, not sure if that would be of any interest.
It might be helpful to your efforts if I finally got around to implementing those https://github.com/clj-commons/rewrite-clj/issues/114.
Regal is a good thought, I forgot about that. I’ll check it out
I’ve been doing more work on clj-kondo, which has got me thinking a lot about the nature of writing lints, and I have some limited experience with rubocop and the rubocop ecosystem so I'm curious what clj-kondo’s lints would look like if built using this kind of system instead of how it's currently done (strictly one pass, lint as you go, etc)
If by a long shot what I build ends up helping clj-kondo, then great. Otherwise, I’m just looking to sate my curiosity and have some fun
And maybe build something others could use! But do the interesting and fun part first, which is build a sexp pattern matching library lol
Cool! If you want to bounce ideas or need some enhancements to rewrite-clj, don't be shy!
there are few libs out there. meander is the most stable i think. if you feel it is a bit too much for the task then i have a small one called matchete
Have a link for machete?
https://github.com/xapix-io/matchete it is incomplete though but enough to give you an overview of how such patterns might look like
This library is cool, and is pretty close to what I was imagining! I'll play around with it and see what I can do. Thanks so much for mentioning it
meander is cool too, but it's a little heavy for my taste. I was hoping to build/use something that's super specific to my particular idea