This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-23
Channels
- # adventofcode (21)
- # announcements (4)
- # babashka (35)
- # beginners (36)
- # calva (76)
- # cider (16)
- # clj-kondo (24)
- # clj-on-windows (12)
- # clojure (70)
- # clojure-europe (7)
- # clojure-nl (13)
- # clojure-spec (3)
- # clojure-uk (3)
- # clojurescript (34)
- # conjure (11)
- # cursive (22)
- # datomic (30)
- # deps-new (2)
- # emacs (36)
- # fulcro (28)
- # gratitude (4)
- # honeysql (16)
- # hugsql (8)
- # introduce-yourself (6)
- # jobs (1)
- # malli (4)
- # missionary (6)
- # off-topic (129)
- # other-languages (34)
- # polylith (3)
- # reagent (9)
- # reitit (27)
- # releases (13)
- # remote-jobs (1)
- # reveal (1)
- # shadow-cljs (2)
- # tools-build (3)
- # tools-deps (18)
- # web-security (7)
- # xtdb (4)
Hi! I'd like built uberscripts to include the shebang line and be executable. Am I missing something or do I have to come up with that bit myself? đ
the shebang isn't added to remain cross-platform (Windows). how would you add an executable in the script?
Windows? What's that? Got your point. Would still be nice to have something ready for the Unix minority.
Yes, I'm considering adding an option for this, or do it automatically, not sure yet
Is it possible to use criterium in a babashka script? When I try include (:require [criterium.core :refer [quick-bench]])
in the ns form (or just require it) I get
Unable to resolve classname: java.lang.management.ManagementFactory
Iâm working on a new version of criterium, which puts all the management bean stuff into an impl namespace. I think it would be straightforward to provide a babashka version of the impl namespace, that just throws on the bits it canât support. That would probably just support time measurement, but might still be useful.
:-D We could add this class, not sure how much extra space it will take, I'll make a branch...
Thatâd be awesome. The rules of the competition says to only use one bit per prime for it to count as a solution âproperâ. I have the sieve working using byte-array and itâs not crucial to get the âfully compliantâ stamp on the solution. But it would be very nice, of course.
I have submitted some solutions in Clojure, but thought babashka should be represented as well. đ
Added it to the bitset
branch, should appear in 10 minutes or so in #babashka-circleci-builds - you can download it from there. I'll be afk for an hour or so.
It's there now. Let me know if this is useful or not for your purposes and how, before I will decide to merge it to master.
Well, Iâve only found one thing that surprises me. In Clojure I can do this:
(-> bs .stream .toArray)
But in babashka that gives me:
No matching method toArray found taking 0 args for class java.util.stream.IntPipeline$Head
It's a little bit more complicated than I expected. I posted a question in the graalvm slack. https://graalvm.slack.com/archives/CN9KSFB40/p1640265505007500
$ ./bb -e '(-> (java.util.BitSet. 8) .stream .toArray)'
#object["[I" 0x498ef7c6 "[I@498ef7c6"]
This one should solve the above issue: https://24932-201467090-gh.circle-artifacts.com/0/release/babashka-0.7.1-SNAPSHOT-macos-amd64.tar.gz
I think I needed to concretely include the java.util.streams.IntStream
class since the toArray
is of a different type than the one in java.util.streams.BaseStream
you mean in bb right? are you using lots of loops? interop in bb is slow because it uses reflection on every call, so I would expect it to be slower than when you go through clojure.core functions
Yes, in bb. BitSets are slower than boolean arrays in Clojure as well, but not as radically.
Havenât tried this particular algo setup with vectors in Clojure, but expecting it to be way slower than boolean-array and BitSet.