Fork me on GitHub
#babashka
<
2020-05-01
>
dominicm07:05:17

.inheritIO is a shortcut for that

Mno09:05:52

Oh cool, maybe having an example for interactive scripts might be nice. I'll try to make one later today

borkdude09:05:25

So, the original problem was: how do you shell out to an interactive program like keytool. But for babashka scripts you can also just use read-line to read user input.

Mno09:05:31

Oh yeah.. that's what I get for skimming quickly during work 😅

borkdude12:05:15

ah, you can package up your project as a zip file and just rename it to .jar:

$ cat foo.clj
(ns foo)

(def x 1)
$ zip foo.jar foo.clj
updating: foo.clj (stored 0%)
$ bb -cp foo.jar -e "(require 'foo) foo/x"
1

athomasoriginal15:05:35

This is really cool. Thank you for sharing!

borkdude18:05:56

funny discovery: datascript does work with GraalVM / babashka, but it requires a lot of memory to compile and the resulting binary is 83mb 🙂

borkdude19:05:52

(on top of the 48 mb that bb currently had, to be fair. so it's +35mb)

nate19:05:16

yeah, but isn't that the other three DB things (next, psql, hsql) combined?

borkdude19:05:33

I pushed it to master, so you can totally try it yourself now. nope, without any other features

nate19:05:29

oh, I meant the +35 was more than the other db ones added

nate19:05:49

wow, this new feature thing is working out really well, very cool

borkdude19:05:27

yeah, it gives more room for experimentation