Fork me on GitHub
#rewrite-clj
<
2021-03-19
>
mikethompson01:03:10

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!

👍 4
❤️ 4
metal 4
lread02:03:40

Awesome! Thanks for sharing @mikethompson !

reefersleep12:03:06

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.

borkdude12:03:09

I want a t-shirt

borkdude12:03:54

@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

borkdude12:03:41

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

reefersleep12:03:16

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.

borkdude12:03:36

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

reefersleep13:03:16

idk how those things would compose.

reefersleep13:03:51

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 🙂

borkdude13:03:28

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

vemv13:03:24

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

borkdude13:03:58

@U45T93RA6 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

🤝 4
borkdude13:03:51

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

vemv13:03:55

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

lread13:03:16

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

lread13:03:03

@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.

borkdude14:03:28

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

borkdude14:03:45

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