Fork me on GitHub
#biff
<
2024-02-20
>
ianjones18:02:07

Is there any reason I would want to use clj over bb for tasks?

👀 1
Jacob O'Bryant01:02:10

They both get the job done. The biggest reason for switching the Biff default to clj was just for the benefit of people who haven't already installed babashka. Since clj tasks are now the default in Biff, another advantage of switching is that you get the most up-to-date task implementations and stuff--the old bb tasks still work, but going forward I'll only be updating the clj tasks. (Already, the uberjar task is only implemented in clj, and only the clj tasks work with the new aero config). The other kind-of benefit is that you get access to any clojure lib instead of just ones that are bb-compatible. That was another impetus for me switching since I wanted to use https://github.com/clojure/tools.build for the uberjar task. There is a https://github.com/babashka/tools.bbuild but it's still experimental. Main downside of clj is you have to bend over backwards to keep startup time low (basically never require anything on startup, only use requiring-resolve), and even then you'll still have 1-3 seconds of startup depending on your machine. Also note that you can still use babashka libs like babashka.fs and such from clj--biff's tasks do that. I think it'd be interesting to put together the right bb command so you could run the biff tasks with either clj or bb. And probably add in a few runtime checks for some of the tasks, i.e. "do this if we're in bb, do that if we're in clj"

Jacob O'Bryant01:02:19

I also kinda like that there's fewer moving parts; e.g. just a deps.edn file instead of deps.edn + bb.edn + bb/deps.edn. and the prod startup command is now basically just clj -M:prod , instead of having a bunch of logic buried within the bb tasks. sticking more to the mainstream clj stuff

👍 3
2