rewrite-clj

https://github.com/clj-commons/rewrite-clj
2021-03-19T01:45:10.050400Z

FYI, we just used rewrite-clj to create a script. It massages legacy re-com codebases to include a newly introduced re-com feature: https://github.com/day8/re-com/tree/master/scripts/add-at-macro Worked a treat. Thanks!

👍 1
❤️ 1
🤘 1
lread 2021-03-19T02:18:40.051800Z

Awesome! Thanks for sharing @mikethompson !

reefersleep 2021-03-19T12:53:06.052600Z

rewrite-clj is dang cool. I wish I’d looked for it before. I’m definitely going to try to use it more in the future.

borkdude 2021-03-19T12:55:09.052800Z

I want a t-shirt

borkdude 2021-03-19T12:55:54.053300Z

@reefersleep I'm considering of writing a bb-like tool with rewrite-clj in it. Do you think this would be useful? Transform code in a blink of an eye

reefersleep 2021-03-19T12:56:27.054100Z

Certainly!

borkdude 2021-03-19T12:56:41.054600Z

Also considering of adding it to bb itself, but not sure how much extra weight this would bring in and if it's generally scripting-focused enough to add

reefersleep 2021-03-19T12:57:16.055600Z

To my shame, I haven’t really used bb yet, though. I keep thinking it’s really cool, but I tend to do things from inside a repl in Cursive, making ad hoc projects for things like scripting things with rewrite-clj.

borkdude 2021-03-19T12:57:36.056Z

Another binary could have have another focus. E.g. also add instaparse to it and other parser-related tools

reefersleep 2021-03-19T13:05:45.056300Z

Good point.

reefersleep 2021-03-19T13:06:16.056900Z

idk how those things would compose.

reefersleep 2021-03-19T13:07:51.057500Z

I need to look through your repositories to get an overview of your projects, and to try to use bb more. I feel like I’m missing out 🙂

borkdude 2021-03-19T13:16:28.058100Z

I would say, anytime you need to write a bash script longer than 5 lines for your clojure build, it's worth taking a look at bb

vemv 2021-03-19T13:23:24.058200Z

funny, this was something that I was hammocking lately. In a production-oriented build I'd use clj, because many prod builds take something like 10m or more, so a difference measured in seconds barely matters. I would still keep the .clj script bb-compatible (shebang and all) so that devs can iterate on the scripts comfortably

borkdude 2021-03-19T13:24:58.058400Z

@vemv true, in CI it usually doesn't matter a lot, but for local development it's nicer to have it all fast at your fingertips I find

🤝 1
borkdude 2021-03-19T13:28:51.058700Z

and it's indeed one of bb's goals to offer a sane migration path to clj when you need to, no "vendor lock-in", all libs in bb also run with the JVM

vemv 2021-03-19T13:30:55.058900Z

yes, I definitely appreciate that bb is not its own island otherwise creating an arbitrary fast-starting lisp would be too easy :)

lread 2021-03-19T13:40:16.059100Z

I wrote a bash script for the first time in ages the other day. It wasn’t horrible but it wasn’t bb.

lread 2021-03-19T13:53:03.062600Z

@borkdude, if rewrite-clj were built into bb (or available via pod), I would have used it the other day. I had to spawn from bb to clojure. It was not traumatic but also not super convenient. In the case of that script, processing time was not a big issue, it was a long running one.

borkdude 2021-03-19T14:00:28.063Z

Yeah, long running scripts (say 5 seconds or longer) are better off on the JVM

borkdude 2021-03-19T14:00:45.063400Z

So it remains to be seen in which case bb would be useful with rewrite-clj included