Fork me on GitHub
#babashka
<
2020-01-04
>
nate16:01:47

I like this a lot: https://clojurians.slack.com/archives/CLX41ASCS/p1578072130072400 It means I can develop my code using the jvm and then uberscript/carve it at the end. The power of the repl flow for dev, the speed of bb for prod (whatever that means).

nate16:01:39

One issue I have with joker is that the interactive dev options are limited.

borkdude16:01:30

Yeah. Did you know bb has a socket REPL too btw?

borkdude16:01:23

More spartan than normal Clojure tooling, so I see your point. It's how I do it myself often too

nate17:01:54

Ah yes. I haven't tried the socket repl yet. Too hooked on prepl (via neovim/conjure) for now.

borkdude19:01:23

@nate_clojurians While I was trying to reduce the binary size (by including only methods in the reflection config and not everything), I found a simple way to include OS-specific classes: https://github.com/borkdude/babashka/blob/a5c2f62d386553267e4e67d504571b9670ae69af/src/babashka/impl/classes.clj#L171

borkdude19:01:50

Also, locking landed on master:

$ ./bb "(def o (Object.)) (def x (volatile! 0)) (defn inc! [] (vswap! x inc)) (doseq [f (map (fn [_] (future (inc\!))) (range 100))] @f) @x"
98
./bb "(def o (Object.)) (def x (volatile! 0)) (defn inc! [] (locking o (vswap! x inc))) (doseq [f (map (fn [_] (future (inc\!))) (range 100))] @f) @x"
100

Nate Sutton19:01:52

I wasn't going to be able to look at that until tonight

Nate Sutton19:01:00

so this'll make things easier

Nate Sutton19:01:34

I thought I had tried something like that and it blew up

Nate Sutton19:01:43

but maybe I was doing something wrong

borkdude19:01:07

Adding more and more classes increases the binary size. We're now at 37MB for MacOS. From now on I'd like to include tests to prove the necessity of each class and only add instance check, constructors, methods and/or fields if necessary

borkdude19:01:01

Zipped it's still pretty good (around 10-11MB) but people are going to judge a tool on its size too I think

Nate Sutton19:01:57

ok, that makes sense

Nate Sutton19:01:12

I can definitely provide that for the stuff I'd like added

borkdude19:01:16

I kept forgetting why I added certain sun.something classes for clj-http-lite but now that's locked down in tests as well

borkdude19:01:31

@sogaiu since you're here: in Windows build environments the Unix implementation classes should now automatically be left out

sogaiu19:01:52

sounds nice!

sogaiu19:01:16

hope to be able to test soon

borkdude19:01:31

(requires bb >= 0.0.60)

sogaiu21:01:11

are you going to aim for spec 1 or 2 ishness?

borkdude21:01:08

first spec 1 ishness and when spec 2 is released, 2 ishness