In the Hoplon README there is a namespace required [hoplon.goog] but it's not used in the example. What is this namespacde for, does it cause necessary side effects when loaded perhaps?
Yeah, it is for side effects. It uses goog closure functions to change attributes instead of jQuery that is the default. Changing that to separate namespaces is one of the proposed ideas moving forward.
I guess nowadays you could do completely without goog or jquery
And that is another one in the list 👍
Also note that the goog libraries will be going into maintenance mode (see #cljs-dev)
Oh, thanks for bringing that to our attention, I was not aware.
😎 Psst, wanna try some hoplon? https://babashka.org/sci.configs/?gist=e83da19df3d2739861334171779f79d5
Wow! Thank you! This is amazing! @alandipert your wish was granted by @borkdude
I think the cell? predicate can be made ~3x faster by using instance? instead of type:
cljs.user=> (deftype Cell [])
cljs.user/Cell
cljs.user=> (defn cell? [x] (= Cell (type x)))
#'cljs.user/cell?
cljs.user=> (time (let [x (->Cell)] (dotimes [i 1000000] (cell? x))))
"Elapsed time: 45.097167 msecs"
nil
cljs.user=> (time (let [x (->Cell)] (dotimes [i 10000000] (cell? x))))
"Elapsed time: 225.481834 msecs"
nil
cljs.user=> (defn cell? [x] (instance? Cell x))
#'cljs.user/cell?
cljs.user=> (time (let [x (->Cell)] (dotimes [i 10000000] (cell? x))))
"Elapsed time: 84.253875 msecs"
This predicate seems to be used quite extensively and on hot paths.
If you agree, I can make a PRAgreed! thanks2
I (re-)installed boot but it crashes:
java.lang.UnsatisfiedLinkError: /Users/borkdude/Library/Caches/JNA/temp/jna13703279612089832314.tmp: dlopen(/Users/borkdude/Library/Caches/JNA/temp/jna13703279612089832314.tmp, 0x0001): tried: '/Users/borkdude/Library/Caches/JNA/temp/jna13703279612089832314.tmp' (fat file, but missing compatible architecture (have (i386,x86_64), need (arm64e)))
clojure.lang.ExceptionInfo: /Users/borkdude/Library/Caches/JNA/temp/jna13703279612089832314.tmp: dlopen(/Users/borkdude/Library/Caches/JNA/temp/jna13703279612089832314.tmp, 0x0001): tried: '/Users/borkdude/Library/Caches/JNA/temp/jna13703279612089832314.tmp' (fat file, but missing compatible architecture (have (i386,x86_64), need (arm64e)))I'm just going to submit a PR and hope that CI will testify that it works
Perhaps a made a bit too many changes, which I personally don't like in a PR, but I couldn't resist ;)
Oh, I need to update javelin to stop using boot and setup the ci 😅
Hey Hoplon-ers... I should have dropped this in here long ago (maybe I did). But I made a thing in Hoplon more than four years ago. It's a tool for people who need SVG clocks for CNC work. https://clocktickgenerator.makertoolmaker.com Source code isn't posted anywhere. I don't have great analytics on it, but the videos have been viewed >5k times. Somewhere, out there, someone's making a clock with Hoplon...