Fork me on GitHub
#babashka
<
2020-05-13
>
uochan05:05:18

I wrote a blog post about AWS CLI wrapping script by Babashka. Since the blog post is written in japanese, I'd like to share only the Gist code:sunglasses: https://gist.github.com/liquidz/7dfdce61ed206e894f27748a931cbbbd

👍 4
🎉 2
didibus06:05:14

To run sci from ClojureScript, we have to use the npm dependency?

didibus06:05:49

When I depend on the clojar one, I get: "clojure.lang.ExceptionInfo: Invalid :refer, var cljs.tools.reader.impl.errors/reader-error does not exist in file target/public/cljs-out/dev/cljs/tools/reader/impl/commons.cljs"

didibus06:05:13

The readme documents how to use from Clojure, Java or JavaScript, but not ClojureScript 😛

jeroenvandijk06:05:30

No the clojure dependency is required. I'm using it from clojurescript

David Pham06:05:52

So I read the docs for pods, am I right by saying pods are way to extend Babashka using different language?

borkdude07:05:45

Yes. Take a look at the filewatcher pod, that's been written in Rust. The sqlite pod in Python.

sogaiu06:05:00

yes, the communication is currently via stdin / stdout

sogaiu06:05:10

so as long as your process speaks the protocol, you're good

borkdude07:05:16

@didibus no, use the dependency from Clojars, not the npm one. That's just for usage from JS

jeroenvandijk09:05:54

I think Babashka Pods are a really nice idea, I can see how it can expands the reach of Babashka even more. E.g. things like babashka-curl could be maintained seperately and for instance made compatible for Windows and all of a sudden all babashka scripts with curl in it will now also work on windows without needing to recompile babashka core. Great! 🙂

jeroenvandijk09:05:34

So I now I’m wondering, do we already need to think about versioning? Maybe you have to make a breaking change. How to fix this?

borkdude09:05:39

That's really nice - but note that babashka.curl already works on Windows, since Windows ships with curl nowadays 🙂

jeroenvandijk09:05:58

Ah ok bad example 😅

borkdude09:05:03

yeah, point taken

jeroenvandijk09:05:12

But I think you have opened a whole new universe

borkdude09:05:01

About versioning: at the moment this is done using the describe op: pods can declare which optional ops they support. E.g. one optional op is shutdown. If the pod supports that, it will be asked to shutdown itself. If it doesn't declare that it can handle this, the pod is shutdown by babashka.

borkdude09:05:33

So there is no explicit versioning, just some negotiation about what the pod does and does not support

jeroenvandijk09:05:23

I’m gonna continue working on an AWS cloudformation tool. Hope to make it a Pod as well

Crispin12:05:38

what are you using for your aws calls? a clojure lib? your own http calls? aws cli tool?

jeroenvandijk13:05:36

A proper language 🙂

jeroenvandijk13:05:38

I have been doing AWS Cloudformation with Clojure for a long time. Started with edn to json, then template support, Prismatic Schema validations etc. No I want to have a proper dsl

jeroenvandijk13:05:54

Oh wait scratch that, i didn’t read the question properly 🙈

jeroenvandijk13:05:52

I’m iterating upon this https://github.com/AdGoji/aws-api extracted parts of cognitect/aws-api to make it compatible with AWS

jeroenvandijk13:05:41

It’s not done yet, probably better to wait before using it

Crispin13:05:03

awesome! thats what I was wondering

Crispin13:05:16

I'll use it undone! 😉

jeroenvandijk13:05:48

I don’t remember in what state I left it last time

borkdude10:05:19

bb-spotify: control Spotify using babashka: https://github.com/kolharsam/bb-spotify