Fork me on GitHub
#babashka
<
2019-12-23
>
steveb8n04:12:10

@borkdude base64 decode is working great. thanks again.

steveb8n04:12:49

FYI brew update did not work on my OSX machine. I was able to redo install and then force link it. Is this just me or a general problem?

borkdude08:12:58

What was the last version you upgraded from and to when this happened?

borkdude10:12:03

@sogaiu @deleted-user I got rid of python in the tests now by writing a socket server in Java / Clojure. I could not replicate the single-threaded behavior of Python though, while (.accept <serversocket>) is a blocking call. So that's maybe nice to add: a test that fails when the socket in wait/wait-for is not closed and passes when it is closed. But maybe not that high priority. PR welcome if you feel like it.

sogaiu14:12:09

thanks! tests seem to run fine here. iiuc the current tests test the case for a successful wait and a timeout. the previous tests tested for a timeout and successful completion of all forms in a bb script. does this sound correct?

borkdude15:12:46

Previously we tested if the socket in wait-for-port was properly closed

borkdude15:12:04

by leveraging the single-threadedness of python

borkdude15:12:27

when the socket was not closed by the first wait-for, a request to the python server would hang

borkdude15:12:34

but now I removed that test

sogaiu15:12:17

thanks for the explanation.

sogaiu15:12:28

i'm trying to wrap my head around what it is important to test here and why.

sogaiu15:12:47

it is not just timing out during waiting that is important to test?

sogaiu15:12:35

what is the importance of knowing whether the socket is closed correctly?

sogaiu15:12:39

i'm feeling quite dense 🙂

borkdude15:12:00

because there was a bug in that code before that left the socket open

borkdude15:12:10

so I was trying to make a test for that bug

sogaiu15:12:21

ah, regression-related then.

borkdude15:12:47

I don't know if that should be called a regression, it was just a bug really

borkdude15:12:56

but yeah, to prevent regressions

borkdude15:12:19

but now it's wrapped in a with-open it should be ok

borkdude15:12:41

since most scripts are short lived anyway, probably no-one ever noticed this bug

borkdude15:12:50

if anyone was using this function at all 😉

borkdude15:12:03

btw, I got clojure.main/repl working

borkdude15:12:06

inside babashka

borkdude15:12:18

see the issue on github

sogaiu15:12:58

if you don't mind -- there's a little bit more about wait-for-port i'd like to ask.

sogaiu15:12:38

if one named the return value of Socket. and had a finally to clean up, would that adversely affect things?

sogaiu15:12:05

i guess that won't work

borkdude15:12:14

I think that's exactly what with-open does

sogaiu15:12:33

ah, it does? nice

borkdude15:12:56

(macroexpand '(with-open [_ _])
)
(let* [_ _] (try (clojure.core/with-open []) (finally (. _ clojure.core/close))))

sogaiu15:12:02

i really need to have my morning tea 🙂

borkdude15:12:54

aaaah green tea, I love it

4
sogaiu16:12:50

i confirmed the expose-main-repl branch examples in the comments. the first one works as you said :thumbsup: i also see failure (no evidence of output from foo) for the second

borkdude16:12:11

yeah, I think I can track that one down later

borkdude16:12:46

That one isn't needed anymore

borkdude16:12:52

I can try later, but not now

borkdude16:12:50

I just tried it... and made some other changes. It seems that works, while some of the tests are broken now

borkdude16:12:52

Will fix later

borkdude10:12:59

I've got two potential logos for babashka. What are your initial thoughts? https://www.dropbox.com/sh/wpzfr4a2in90qpr/AACc_IbNf6lbmnOQ56H2zUmya?dl=0

jeroenvandijk17:12:37

Looks sharp! I see the babashka shape obviously and the terminal. I miss the link with Clojure, as I think that is an important part of what Babashka is

borkdude17:12:35

it's a hacker granny I guess!

borkdude17:12:07

the designer Nikita doesn't agree with my lambda idea though, he wants the >_ ones...

borkdude17:12:36

While everyone on Twitter and here wants the other one 😉

borkdude17:12:57

@U0FT7SRLP The lambda kind of hints at Clojure I guess

borkdude17:12:35

@deleted-user Are you good with SVG / design?

borkdude17:12:14

that's where name initially came from (clojure in clojure)

jeroenvandijk18:12:42

Sorry didn't study the second one properly. I like the lambda indeed!

jeroenvandijk17:12:14

Any interest in this implementation of clojure.core/resolve ?:

#?(:bb
   (defn resolve [x]
     (assert (symbol? x))
     (try (eval x)
          (catch Exception _
            nil))))

borkdude17:12:17

I already added resolve yesterday 🙂

borkdude17:12:18

$ bb "((resolve 'inc) 0)"
1

jeroenvandijk17:12:14

time for an update

jeroenvandijk10:12:46

you lost me 😎👏

borkdude10:12:00

Just view the release notes of v0.0.49 and you'll understand 🙂

jeroenvandijk11:12:28

I understand what you are doing, but it feels like magic anyway 🙂