babashka

https://github.com/babashka/babashka. Also see #sci, #nbb and #babashka-circleci-builds .
cmdrdats 2020-12-08T09:56:35.152700Z

Good morning - I'm trying to figure out how to use https://github.com/AdGoji/aws-api with babashka, but I'm afraid I can't figure out how to actually reference the code? Do I need to checkout the project and provide a classpath a la -cp somehow?

2020-12-08T10:07:32.152900Z

@cmdrdats I’ve only tested it with leiningen . No with babashka

2020-12-08T10:07:49.153100Z

I’m doing some quick tests now with babashka but I see it goes wrong with loading the dependencies

cmdrdats 2020-12-08T10:08:35.153400Z

ah, ok - for interest sake, how does one load dependencies in babashka?

cmdrdats 2020-12-08T10:09:07.153600Z

thanks for testing this for me 🙂

2020-12-08T10:11:15.153800Z

Ah wait, I forgot an important detail.. You need the jvm to generate the requests maps. Once you have that you can probably call it from babashka (never tested that). So not ideal

2020-12-08T10:12:40.154Z

So it uses the com.cognitect.aws library (currently only works on jvm) to generate the template request maps and with those templates you can call it in a GraalVM project and maybe babashka

cmdrdats 2020-12-08T10:12:53.154200Z

ah, ye - not ideal :rolling_on_the_floor_laughing: I'll just handle it in plain old clj for now then - would have liked to run this in babashka, but no trainsmash

2020-12-08T10:13:05.154400Z

I understand 🙂

2020-12-08T10:13:16.154600Z

sorry for the disappointment

cmdrdats 2020-12-08T10:13:34.154800Z

not at all! thanks for the effort, I appreciate it

borkdude 2020-12-08T10:35:51.155Z

@cmdrdats Many people just shell out to the aws CLI from babashka. Also there is an AWS pod: https://github.com/tzzh/pod-tzzh-aws

cmdrdats 2020-12-08T10:37:02.155400Z

@borkdude ah, I see - makes sense - thank you 🙂

borkdude 2020-12-08T10:38:15.155600Z

That aws pod is Go code generated from a specification (I believe) using Clojure (babashka itself). Pretty nifty :)

borkdude 2020-12-08T10:39:11.155800Z

@thomas.ormezzano can maybe tell you more about it if you're interested. Right now you can't send blobs to s3 with it, this needs some special attention.

borkdude 2020-12-08T11:17:49.156800Z

A WIP under consideration thing:

(require '[babashka.deps :as deps])

(deps/add-deps '{medley/medley {:mvn/version "1.3.0"}})
;; or should we support passing in `{:deps ...}` so we can also have :paths ["src" "test"]?
;; and what about aliases?

(require '[medley.core :as m])

(m/index-by :id [{:id 1} {:id 2}]) ;; works
This now works in the branch babashka-deps (see #babashka_circleci_builds). It shells out to java for resolving deps but just like clojure it is fast once the classpath is cached.

👍 1
🎉 1
borkdude 2020-12-08T11:22:18.157200Z

Feel free to discuss here: https://github.com/borkdude/babashka/issues/473#issuecomment-740559228

borkdude 2020-12-08T21:56:19.158100Z

Awesome, the babashka repo now has a place for discussions, Q/A, etc. https://github.com/borkdude/babashka/discussions

borkdude 2020-12-08T21:57:51.158500Z

I assume it's possible to open a new topic there for others than me?

lukasz 2020-12-08T21:58:07.158800Z

Yep, I can see a big green "New discussion" button