Fork me on GitHub
David Pham07:04:12

Thanks @borkdude. I downloaded basbashka into my working environment and I am so happy to use Clojure at bash level :)

🎉 4
David Pham07:04:56

I will be one of your first client for your babashka book :)


@neo2551 Thanks for the feedback 🙂

David Pham07:04:32

This is also quite good for teaching and demonstration: just download the bb.exe and then you are good to use Clojure (at least a big chunk of it).


@neo2551 There is also a 4clojure port to a bb script:

David Pham09:04:00

Thanks :). You know what would be really meta? Having the leiningen script file run under babashka

David Pham09:04:21

But I guess it is a bit too complicated haha


@neo2551 In fact I've ported the clojure bash script to babashka here:

David Pham09:04:00

Yep I need to check how I can use it! Thanks


I don't expect the lein bash script to be more complicated than this -- it's probably very similar


so it could be a nice exercise


The nice thing about porting it to bb (or clojure + graalvm for that matter) is that it becomes (more) portable across OSes


No need to mess with .bat files anymore

David Pham09:04:43

Agree, I think it could be a nice idea, I am not sure I am fit to the task so I don’t want to push it too much haha.

David Pham09:04:26

By the way, I can’t use deps.exe because of company firewall for the Clojure-tools jar unfortunately.


@neo2551 There is an easy workaround: download the .jar file yourself and put it in ~/.deps.clj/ClojureTools


Maybe it's good to document this (if it works for you)


or maybe the script can print a message when the download fails because of a connect error


you can maybe write down the exception you see when trying to invoke the script?

David Pham10:04:01

I think my issue is company proxy bug :/

David Pham13:04:19

Yep your tricks work :)


On master: clojure.repl/source (only works with code loaded from source, not with pre-compiled code)

$ export BABASHKA_CLASSPATH=$(clojure -Sdeps '{:deps {mvxcvi/arrangement {:mvn/version "1.2.0"}}}' -Spath)
$ rlwrap bb
user=> (require '[arrangement.core :as order])
user=> (source order/rank)
(defn rank
  "Comparator function that provides a total ordering of EDN values. Values of

🎉 8