Fork me on GitHub
#babashka
<
2020-04-16
>
David Pham07:04:12

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

🎉 1
David Pham07:04:56

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

borkdude07:04:30

@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).

borkdude07:04:34

@neo2551 There is also a 4clojure port to a bb script: https://github.com/porkostomus/4bb

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

borkdude09:04:39

@neo2551 In fact I've ported the clojure bash script to babashka here: https://github.com/borkdude/deps.clj

David Pham09:04:00

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

borkdude09:04:13

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

borkdude09:04:27

so it could be a nice exercise

borkdude09:04:37

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

borkdude09:04:55

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.

borkdude10:04:51

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

borkdude10:04:23

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

borkdude10:04:50

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

borkdude10:04:08

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 :)

borkdude19:04:10

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])
nil
user=> (source order/rank)
(defn rank
  "Comparator function that provides a total ordering of EDN values. Values of
...

🎉 2