Fork me on GitHub
#babashka
<
2022-07-28
>
borkdude09:07:11

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

❤️ 6
teodorlu09:07:07

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
lispyclouds13:07:26

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?

1
borkdude13:07:59

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

1
👍 1
sheluchin15:07:45

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
pinkfrog12:07:55

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.

borkdude12:07:38

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

Martynas M16: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..?

lispyclouds16:07:30

Yes it would work normally on the JVM.

Martynas M17:07:23

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

lispyclouds17:07:09

its intended to be a least friction switching 🙂

borkdude17:07:08

Other choices that are both compatible with bb + graalvm: • org.httpkit.client (built-in) • https://github.com/schmee/java-http-clj (based on java.net.http) • clj-http-lite

borkdude17:07:30

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

hlship17:07:59

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
3
borkdude17:07:27

Thanks and congrats on the new job!