babashka

https://github.com/babashka/babashka. Also see #sci, #nbb and #babashka-circleci-builds .
Kira McLean 2021-03-07T13:20:20.041700Z

Are people using babashka to make command-line apps (i.e., more than just personal scripts, ones that are shareable, versioned, etc)? I just came across https://github.com/nubank/docopt.clj, and the first example shows usage babashka. It seems really cool, but it got me wondering how to distribute a util made with babashka. Sharing a gist is the first thing that came to mind 😅 but is there a way to share it as an actual app/executable?

borkdude 2021-03-07T13:22:24.042500Z

@kiraemclean Welcome! Babashka nowadays has the ability to set the classpath from within a script. Here is an example for camel-snake-kebab: https://github.com/babashka/babashka/blob/master/doc/projects.md#camel-snake-kebab

borkdude 2021-03-07T13:23:01.043200Z

Feel free to update those docs for docopt as well

Kira McLean 2021-03-07T13:23:08.043400Z

oh cool!

Kira McLean 2021-03-07T13:24:08.043700Z

thanks.

Kira McLean 2021-03-07T13:27:17.046700Z

I was also wondering about how to share/distribute Babashka scripts.. in practice I'm basically trying to decide between making a cli with Clojure and building a native image vs. making a Babashka script (I think I can do everything I want with it, but not actually sure yet). Is that an intended use of Babashka, though? I guess my real question is, is there a good way to package a distribute a Babashka "app", or is that not really what it's for?

Kira McLean 2021-03-07T13:28:12.047700Z

apologies for probably missing an obvious answer.. I'm just starting to use Babashka a little bit, but so far only for personal things (which is already amazing!)

borkdude 2021-03-07T13:29:42.048500Z

It's a very good question. So far people usually put their scripts in a git repo which you can then just clone on your machine, and possibly put it to your $PATH

borkdude 2021-03-07T13:29:59.048800Z

This is a recent example: https://github.com/robertfw/bunpack

Kira McLean 2021-03-07T13:30:25.049200Z

makes sense.. that's a really useful example, thanks!

borkdude 2021-03-07T13:31:05.050Z

I've been thinking if we should maybe have some central repo for all kinds of scripts that people can contribute to and selectively install from, but I haven't really thought deeply about it

Kira McLean 2021-03-07T13:32:59.051500Z

interesting! that could be cool for sure. I guess at the end of the day if you want a platform-agnostic executable you'll have to just make a native image.. I suppose it could still use Babashka though, or just have it as a dependency that could be managed by brew or other package managers..

borkdude 2021-03-07T13:33:23.052300Z

yeah, you could also distribute scripts via normal package managers for sure

borkdude 2021-03-07T13:33:57.053200Z

I guess the solution will work itself out if the script becomes really popular

Kira McLean 2021-03-07T13:33:59.053300Z

interesting.. anyway, just got me thinking. I usually put off thinking about how people are actually going to use my code until too late and then regret not making different decisions early on 😆 trying to force myself to finally learn the lesson..

Kira McLean 2021-03-07T13:34:10.053600Z

yeah I think you're right.

Kira McLean 2021-03-07T13:34:41.054300Z

it totally makes sense not to go crazy with packaging/deployment concerns for experiments.

borkdude 2021-03-07T13:35:07.055200Z

People sometimes also use gists. Here is one for an http server a la python -m http.server: https://gist.github.com/holyjak/36c6284c047ffb7573e8a34399de27d8 But gists are generally a bit difficult to work with if you want to collaborate

Kira McLean 2021-03-07T13:35:47.055900Z

yeah just putting it in a gist was my first thought.. that's usually how I've shared little one off scripts before