This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # 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 (27)
- # conjure (11)
- # cursive (22)
- # datomic (30)
- # deps-new (2)
- # emacs (36)
- # fulcro (28)
- # gratitude (4)
- # honeysql (16)
- # hugsql (8)
- # introduce-yourself (5)
- # 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:
But in babashka that gives me:
(-> bs .stream .toArray)
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 "[[email protected]"]
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
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.
⚠️ I need a few people who use the
uberscript option for testing. I'm making a few changes to this which should improve loading namespaces which use pods, etc. But with every change there is a risk of breaking, so please respond in a thread if you want to test the change! 🧵