Fork me on GitHub
#babashka
<
2019-12-27
>
borkdude08:12:03

@deleted-user yes macros are supported, but if you need to see the expansion with macroexpand you can do that in a normal Clojure REPL for now. I’ll make an issue to add it

jeroenvandijk15:12:59

Anyone know of a spec like way of desctructuring data compatible with Babashka/GraalVM?

jeroenvandijk15:12:36

I would like to do something like

(s/conform (s/cat :a string? :b integer? :c (s/? integer?) :d string?) data)

borkdude16:12:31

Malli might have this, not sure, but it works with GraalVM

jeroenvandijk16:12:05

Thanks! I just had a look. It fails on derive:

export BABASHKA_CLASSPATH="$(clojure -Sdeps '{:deps {malli {:git/url "" :sha "07c8c61c5f469769291bd6cf5c938a3a0e94d41d"}}}' -Spath)"
 bb -e
Babashka v0.0.49 REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.

user=> (require '[malli.core :as m])
Could not resolve symbol: derive [at /Users/jeroen/.gitlibs/libs/borkdude/sci/29c6ab20416b8662296f64f3ce92fdbd826bc286/src/sci/impl/utils.cljc, line 5, column 2]
sci.impl.utils=>

jeroenvandijk16:12:14

Will try something different for now

borkdude16:12:38

oh I wasn't suggesting malli works with babashka, but it does work with graalvm

borkdude16:12:49

if you want to do it in babashka, I would just write that manually

jeroenvandijk16:12:53

Looking at the code of mali it is probably something more than just derive . I see defprotocol etc.

jeroenvandijk16:12:14

I have to rethink my approach :)

jeroenvandijk16:12:39

But good to know it works with GraalVM at least

borkdude16:12:19

Eventually I want to port spec to babashka, but that will take some time

borkdude16:12:46

Also I want to port clojure.test, that might be useful for integration testing

borkdude16:12:59

But also not trivial

jeroenvandijk16:12:01

yeah I can imagine

jeroenvandijk16:12:23

I'm guessing you ported deps.clj for internal use in Babashka as well?

borkdude16:12:08

I ported the clojure bash script to clojure to see how far I could get it to run with babashka, but now it runs with it

borkdude16:12:37

but then I thought: if I have it in clojure anyway, I might as well produce binaries from it

borkdude16:12:15

it's not used internally by babashka, it's just a script that you can run with both JVM clojure and babashka

borkdude16:12:54

also a reason for it is that installing clojure on Windows is not trivial. but now you can just download one single file and it will do the rest for you

borkdude16:12:43

I remember writing a custom clojure installer for macOS CI, because the linux script didn't work there. also one thing I won't have to do anymore

jeroenvandijk16:12:00

Very cool 🙂

borkdude16:12:26

that was the custom script I had to write to make it work in CI