Fork me on GitHub

If I were to give a 3 hour workshop about babashka, which points would you like to see covered (for an announcement page to poll interest). I've got this so far:

** Scripting: moving from bash to Clojure
** Overview of the babashka toolbox (libraries, pods)
** Starting sub-processes: babashka.process
** Managing files: babashka.fs
** Writing CLIs: babashka.cli
** Managing your project with babashka tasks
** Sharing code between clojure and babashka
** Bonus, if time permits: writing a small internal web application

❤️ 8

Clearly babashka.fs and babashka.process for me. I'd be very much interested in a small problem approached with Unix tools / bash, compared to how it would look in babashka. Also interested in whether there are differences in error habdling.

👍 1

One more suggestion: As a lib author/user of a thing thats not currently bb compatible, tips and techniques on how to make it compatible if possible?


yeah, I'll call it "sharing code between clojure and babashka"

👍 1

Perhaps related or covered in other sections, but maybe something about the different approaches to organizing your babashka code? There is the --config flag to point to bb.edn files, tasks can be re-usable/downloaded from a URL, etc.

👍 1

For bb.cli, I have several commands. Each command takes a common configuration. Where shall I put it? I don’t want to initialize the config in every command. I wonder if dispatch supports a pre-invocation hook for all commands. Or not, what the following way do you recommend? 1. Define a non-dynamic var, and use alter-var-root to update the value inside the -main function. 2. Define a dynamic var and use binding.


@i Let's take this to #babashka-cli :)

Martynas Maciulevičius16:07:47

Can I use babashka/babashka.curl in my Clojure project instead of clj-http? Is this something intended? Well... it has a clojars JAR.... so probably..?


Yes it would work normally on the JVM.

Martynas Maciulevičius17:07:23

Nice. It also looks like the API is the same as in clj-http. So no refactoring! 😄


its intended to be a least friction switching 🙂


Other choices that are both compatible with bb + graalvm: • org.httpkit.client (built-in) • (based on • clj-http-lite


bb curl is fine if you're doing a few requests


So just a note of thanks on bb ... it's very nice, and very fast, and I appreciate the effort put into the documentation. I was previously using Joker, but with the new job, I'm starting to write new tools from a blank slate, so I'm just embracing bb.

babashka 4

Thanks and congrats on the new job!