Fork me on GitHub
#babashka
<
2022-08-17
>
Jeffrey Bay14:08:39

is there a babashka equivalent of this code?

user=> (mapv :name (filter (comp :public :flags) (:members (clojure.reflect/reflect d))))
Could not resolve symbol: clojure.reflect/reflect [at <repl>]
user=> (require 'clojure.reflect)
java.lang.Exception: Could not find namespace: clojure.reflect. [at <repl>:10:1]

Jeffrey Bay14:08:08

i'm trying to get the functions/methods available on an object, but babashka doesn't seem to have clojure.reflect available?

borkdude14:08:02

Currently not exposed, but I think we're already using this somewhere internally so we could probably just expose it without growing the binary. Worth posting an issue for

borkdude15:08:49

If you want, you could try a PR. When this is added, I'll check the binary size difference.

nonrecursive17:08:25

i’m trying to load lanterna w/ (pods/load-pod 'org.babashka/lanterna "0.0.1-SNAPSHOT") and it looks like it’s not finding the artifact (https://14-303520083-gh.circle-artifacts.com/0/release/pod-babashka-lanterna-0.0.1-SNAPSHOT-macos-amd64.zip), anything I can do to help publish that?

borkdude18:08:02

@U0AQ1R7FG I'll retrigger a build

nonrecursive18:08:19

@U04V15CAJ sweet, thank you! 🙏

JeffR19:08:38

bb supposes to be quick startup. However, in one of my windows machine, it is slow. Here are the measurement. Any suggestions about what to do? Measure-Command {bb describe} Days : 0 Hours : 0 Minutes : 0 Seconds : 0 Milliseconds : 999 Ticks : 9992031 TotalDays : 1.15648506944444E-05 TotalHours : 0.000277556416666667 TotalMinutes : 0.016653385 TotalSeconds : 0.9992031 TotalMilliseconds : 999.2031 Measure-Command {clojure -Sdescribe} Days : 0 Hours : 0 Minutes : 0 Seconds : 0 Milliseconds : 7 Ticks : 78980 TotalDays : 9.1412037037037E-08 TotalHours : 2.19388888888889E-06 TotalMinutes : 0.000131633333333333 TotalSeconds : 0.007898 TotalMilliseconds : 7.898

Alex Miller (Clojure team)19:08:53

the latter doesn't start a jvm so I'm not sure it's a very useful comparison point

Alex Miller (Clojure team)19:08:04

I'm not sure what the former does exactly but the latter will just be some bash that echoes via cat

borkdude20:08:19

Continuing in thread @jeff66ruan , @alexmiller :

borkdude20:08:06

bb does run a JVM to calculate deps from bb.edn (if present) so if you run bb for the first time, it might take a second, the second time there will be no JVM invocation because of caching. So be sure to either run bb from a directory that has no bb.edn or run it a second time.

JeffR02:08:05

I created a new folder so no bb.edn in the current path. Here is running data. there are a few ran quick but others not. PS C:\Temp\new> Measure-Command {bb describe} Days : 0 Hours : 0 Minutes : 0 Seconds : 0 Milliseconds : 712 Ticks : 7129463 TotalDays : 8.25169328703704E-06 TotalHours : 0.000198040638888889 TotalMinutes : 0.0118824383333333 TotalSeconds : 0.7129463 TotalMilliseconds : 712.9463 PS C:\Temp\new> Measure-Command {bb describe} Days : 0 Hours : 0 Minutes : 0 Seconds : 0 Milliseconds : 61 Ticks : 614657 TotalDays : 7.11408564814815E-07 TotalHours : 1.70738055555556E-05 TotalMinutes : 0.00102442833333333 TotalSeconds : 0.0614657 TotalMilliseconds : 61.4657 PS C:\Temp\new> Measure-Command {bb describe} Days : 0 Hours : 0 Minutes : 0 Seconds : 0 Milliseconds : 969 Ticks : 9699660 TotalDays : 1.12264583333333E-05 TotalHours : 0.000269435 TotalMinutes : 0.0161661 TotalSeconds : 0.969966 TotalMilliseconds : 969.966 PS C:\Temp\new> Measure-Command {bb describe} Days : 0 Hours : 0 Minutes : 0 Seconds : 0 Milliseconds : 61 Ticks : 610818 TotalDays : 7.06965277777778E-07 TotalHours : 1.69671666666667E-05 TotalMinutes : 0.00101803 TotalSeconds : 0.0610818 TotalMilliseconds : 61.0818 PS C:\Temp\new> Measure-Command {bb describe} Days : 0 Hours : 0 Minutes : 0 Seconds : 0 Milliseconds : 68 Ticks : 683748 TotalDays : 7.91375E-07 TotalHours : 1.8993E-05 TotalMinutes : 0.00113958 TotalSeconds : 0.0683748 TotalMilliseconds : 68.3748 PS C:\Temp\new> Measure-Command {bb describe} Days : 0 Hours : 0 Minutes : 0 Seconds : 0 Milliseconds : 955 Ticks : 9559010 TotalDays : 1.10636689814815E-05 TotalHours : 0.000265528055555556 TotalMinutes : 0.0159316833333333 TotalSeconds : 0.955901 TotalMilliseconds : 955.901 PS C:\Temp\new>

borkdude10:08:22

@jeff66ruan How did you install bb?

borkdude10:08:33

And which version?

borkdude10:08:47

Ah I see that some invocations are fast: Milliseconds : 61 Not sure what's going on with your machine, but could it be a virus scanner? I've found this to be the answer several times on Windows ;)

JeffR20:08:48

@U04V15CAJ It is the scanner! bb can always run fast after I turned the scanner off. Thanks!

👍 3