rewrite-clj

https://github.com/clj-commons/rewrite-clj
borkdude 2019-11-04T17:50:15.046100Z

Yannick Scherer, the author of rewrite-clj, is alive. Proof: he just liked a post of mine on Twitter. https://twitter.com/xscys

1
plexus 2019-11-04T20:04:43.048Z

FWIW I had a short email conversation with Yannick last year. I never met him but we have a mutual friend, I was doing stuff with rewrite-clj and was curious about the status. He wrote he wanted to get a few more things in, which he did, like better support for namespaced maps (although I believe it can still be improved.) He also wrote > Now, based on the already observed busy-ness I'd welcome anyone that would like to take the role of a co-maintainer. I will respond to PRs and issues eventually but I just cannot guarantee short latencies. So, yes, I'm all for more activity within the project but if I'm the sole maintainer I fear that frustrations will arise for all sides.

plexus 2019-11-04T20:05:36.048700Z

I also floated the idea of someone else requesting Clojurists Together funding for working on rewrite-clj, which he thought was a cool idea. > It is an interesting idea and maybe this will make things more interesting for potential co-maintainers. Personally, I don't need financial incentives to work on OSS – at the moment it's a question of timing/energy, mostly influenced by my work situation (lots of early stage projects, new responsibilities, all that stuff).

plexus 2019-11-04T20:06:53.049400Z

to me this would make a lot of sense, since so much tooling depends on it it would be a really good way to allocate some of that grant money

borkdude 2019-11-04T20:09:26.050300Z

He has never responded to any Github issue or e-mail from anyone in this group (at least not since April 2019). At some point we worried that there was something wrong.

borkdude 2019-11-04T20:09:47.050700Z

Meanwhile there are several forks of rewrite-clj around with various patches.

plexus 2019-11-04T20:10:48.051700Z

my guess is he's just really busy with other stuff. maybe it's time to consolidate everyone's forks into clojure-commons

borkdude 2019-11-04T20:12:19.052300Z

@lee is working on a .cljc port

borkdude 2019-11-04T20:12:24.052500Z

which will be released under clj-commons

borkdude 2019-11-04T20:12:31.052700Z

maybe he should do a CT if he's up for it

borkdude 2019-11-04T20:13:03.053400Z

I've made changes to rewrite-clj that are specific to clj-kondo and probably not mergeable

plexus 2019-11-04T20:13:23.053800Z

yeah I saw your monkey patch. You don't see a lot of those in Clojure 🙂

borkdude 2019-11-04T20:13:40.054100Z

it used to be a monkey-patch but now it's a vendored version with a patch

plexus 2019-11-04T20:14:17.054300Z

ah I see

borkdude 2019-11-04T20:15:08.055100Z

one thing I fixed was the namespaced map behavior (this was the monkey patch) but later I also changed how metadata is processed

borkdude 2019-11-04T20:15:18.055400Z

because that was a common source of errors in clj-kondo

plexus 2019-11-04T20:16:47.055800Z

my main frustration is that the zipper doesn't skip over uneval nodes

borkdude 2019-11-04T20:18:00.056100Z

what if you want to rewrite it?

plexus 2019-11-04T20:22:35.056900Z

then you use clojure.core/zip functions

plexus 2019-11-04T20:23:06.057600Z

the zipper skips over comments and whitespace, but not over uneval. uneval to me is just another syntax for a comment, so it's not very consistent.

borkdude 2019-11-04T20:23:44.058100Z

right. I used to use the zippers on clj-kondo a bit, but after doing some performance tests I found that manually editing was way faster

2019-11-04T20:31:58.058800Z

for some things it might be nice to not skip comments and whitespace...perhaps it's practical to consider configurable skipping?

lread 2019-11-04T20:39:55.061500Z

yeah you suggested this many moons ago @sogaiu and I still think it is a good option. We’ll break a ton of code if we change default behaviour so an option makes sense.

2019-11-04T20:42:09.062500Z

may be it can be considered if there is clojurists together funding 🙂

pez 2019-11-04T20:42:13.062700Z

What is an uneval node?

lread 2019-11-04T20:42:51.063100Z

#_

lread 2019-11-04T20:43:28.063900Z

that took too long to type on my phone 🙂

2019-11-04T20:44:07.064100Z

lol

2019-11-04T20:48:28.065Z

i'm not sure i've seen the terminology used elsewhere -- i don't see it in the clojure source. there a close thing is the DiscardReader, so may be it could have been called a discard node?

borkdude 2019-11-04T20:57:35.065400Z

I've been calling it uneval for a while now, but probably got it from rewrite-clj

lread 2019-11-04T22:47:13.069700Z

As planned, I am diving back into rewrite-cljc and working toward a release. I'll post progress here as a device to (for sure, maybe, probably) keep myself from distraction. :simple_smile: I'll start with taking a look at getting tests running under graal. I've got existing graalifcations to use as a reference (thanks @borkdude!).

👍 2
lread 2019-11-04T22:54:06.070Z

hey @plexus, 👋 ! One thing I did not really notice until digging into the rewrite-clj code is that you can instead use the * functions from rewrite.clj.zip to get at the raw zipper. For example down* is the raw version of down. Actually this is the only way to go if you have positional support enabled on your rewrite-clj zipper.

snoe 2019-11-04T23:01:09.071100Z

@lee is rewrite-cljc based on the clj or the cljs api? are there other changes/differences?

lread 2019-11-04T23:04:03.073100Z

@snoe, there will be minor gotchas, but I am shooting for compatibility with both. Here's my current summary: https://github.com/lread/rewrite-cljs-playground/blob/master/doc/design/01-merging-rewrite-clj-and-rewrite-cljs.adoc

lread 2019-11-04T23:05:45.074600Z

My intention is that it should be a drop in replacement for rewrite-clj and rewrite-cljs. Minor changes will be required for rewrite-cljs if you are using positional support.

lread 2019-11-04T23:07:28.075300Z

Happy to hear any feedback or concerns from existing rewrite-clj and rewrite-cljs users.