Fork me on GitHub
#babashka
<
2020-06-11
>
telekid00:06:11

Fun little babashka script preamble that automatically downloads and installs babashka if it isn’t already present

telekid00:06:42

it’s a little messy, just proving the concept

borkdude09:06:43

If you have published your final preamble somewhere, we can link it in https://github.com/borkdude/babashka/blob/master/doc/libraries.md

sogaiu01:06:28

i guess this sentence in the README might be changing before long? > No defprotocol, defrecord and unboxed math.

borkdude07:06:48

Thanks. I now updated it to: > - No deftype, definterface and unboxed math. 😛

helios07:06:20

I was wondering if there could be a way of removing " from the prn output of bb. I'm writing a long ops script 😄

borkdude07:06:49

prn by definition prints quotes. if you don't want that, use println.

borkdude09:06:45

Just released pod-babashka-postgresql and pod-babashka-hsqldb v0.0.1: https://github.com/babashka/babashka-sql-pods

jeroenvandijk11:06:34

@borkdude To test the performance of the PR I’ve installed multitime via https://github.com/ltratt/multitime

~/bin/multitime -n10 -s0 tmp/sci-without-checks "(loop [val 0 cnt 1000000] (if (pos? cnt) (recur (inc val) (dec cnt)) val))"
multitime: Error when attempting to run tmp/sci-without-checks
Do you know what I’m missing?

jeroenvandijk11:06:44

I couldn’t find a mention of that script sci-without-checks

borkdude11:06:12

@U0FT7SRLP you should run script/compile. this will produce a sci binary which you can then run with multitime

borkdude11:06:29

currently graalvm 20.1.0 java11 is used

borkdude11:06:59

tmp/... is just a binary I copied to a tmp dir for testing

borkdude11:06:04

so I could compare various versions

jeroenvandijk11:06:09

ah yeah makes sense

jeroenvandijk11:06:29

Ok still need to update java 11 and I still need to fix my Graal setup since I moved to mac Catalina 🙈 So I need some more time

borkdude11:06:55

you don't need to install java11, just download a graalvm, unzip it to your downloads dir and then

export GRAALVM_HOME=/Users/borkdude/Downloads/graalvm-ce-java11-20.1.0/Contents/Home

jeroenvandijk11:06:51

In case you ever upgrade to Catalina, note that you have to run sudo xattr -r -d com.apple.quarantine $HOME/bin/graalvm-ce-java11-20.1.0 (on the root not on the nested Contents/home). From this comment https://github.com/oracle/graal/issues/1724#issuecomment-540160024

😢 4
borkdude11:06:35

macOS is becoming more and more hostile towards unsigned binaries

jeroenvandijk12:06:24

I guess it’s good eventually, but it’s painful if you are upgrading unexpectedly. I didn’t find this link at first and destroyed my old Graalvm setup (it asks to move binaries and I clicked “yes” a couple of times)

jeroenvandijk12:06:20

ok executed the tests for the different commits. I don’t really see a pattern https://github.com/borkdude/sci/pull/349#issuecomment-642624211

borkdude12:06:41

maybe try with a higher number than 10

jeroenvandijk13:06:45

ok thanks, trying 3 x 100 now. Will report back in 15 minutes 🙂

jeroenvandijk13:06:33

I might misinterpret the results, but i don’t feel there is a real difference between the different commits

borkdude13:06:32

ok, then it might be a co-incidence what I saw on my local machine

cldwalker13:06:09

Hey y’all. Wrote up a https://github.com/cldwalker/bb-clis/blob/master/bin/bb-try to make it easy to try a library with bb - https://github.com/cldwalker/bb-clis#bb-try. For example bb-try aero puts you in a bb repl with aero /cc @neo2551

❤️ 12
nate14:06:50

Very cool to see an example of running carve on an uberscript. I was wondering how to do that. Thanks!

borkdude14:06:31

Maybe we could also have a carve pod 😉

cldwalker15:06:37

Glad the carve example is helpful and thanks again to borkdude for the awesome tooling 🙂

nate16:06:36

is carve able to run in babashka as a lib? if not, then definitely a carve pod would be cool

borkdude17:06:57

it's not. however, carve is built using two parts: clj-kondo for analysis and rewrite-clj for removing things from code. Nowadays we have the ingredients needed as pods: - clj-kondo can run as a pod. - https://github.com/babashka/pod-babashka-parcera can be used to remove things from code

borkdude17:06:14

so theoretically, one can build a script which does a similar thing to carve using these two pods

David Pham14:06:29

Thanjs

🐈 4