This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-22
Channels
- # aleph (20)
- # announcements (4)
- # babashka (72)
- # beginners (64)
- # biff (5)
- # calva (146)
- # cider (5)
- # clj-kondo (18)
- # clj-together (3)
- # cljsrn (28)
- # clojure (95)
- # clojure-berlin (2)
- # clojure-europe (34)
- # clojure-nl (2)
- # clojure-norway (3)
- # clojure-uk (3)
- # community-development (7)
- # conjure (1)
- # cursive (2)
- # data-science (12)
- # datalevin (13)
- # datomic (17)
- # events (2)
- # figwheel-main (5)
- # fulcro (7)
- # helix (8)
- # hyperfiddle (52)
- # jobs (1)
- # malli (14)
- # off-topic (32)
- # polylith (24)
- # remote-jobs (7)
- # scittle (3)
- # shadow-cljs (14)
- # slack-help (3)
- # spacemacs (3)
- # vim (2)
- # xtdb (6)
Y'all know about https://github.com/borkdude/speculative? It was an attempt at adding clojure.spec specs for nearly all of the clojure.core functions, both as a means of documentation and a way to check input-output when doing development. It stalled out as clojure.spec is not performant enough. now that I've added instrumenting vars in other namespaces, I wonder if we could do a malli version of speculative, see if the performance is any better/if it would help uncover spaces where malli could improve
speculative still has its use, e.g. in https://borkdude.github.io/re-find.web/ I think even with a malli speculative, instrumenting core would just be way too slow and probably not worth it
oh cool! I didn't realize you were using it for re-find, I thought you were using something like grasp.
a good test case would be advent of code puzzles. at one point I had a solution which took 15 minutes with instrumentation and 50ms without or so
yeah, it's debatable if it would be worth it, but malli is pretty dang fast comparatively: 40ns vs 450ns for simple schemas. 10x speed increase is sharp
How do validate that I have a valid malli (vector) schema? Or, what is the schema of schemas? eg.
[:map
[:attribute :keyword]
[:schema [:and :vector :schema]]
.core/child-error {:type :schema, :properties nil, :children nil, :min 1, :max 1}Looks like that checks to see if it’s an instance of a schema, which would force me to invoke (schema) on the data. I’ve been on the fence on how proactive I should be about doing that. I do see there is (form) which does get the data back… I was expecting that there was a schema schema somewhere though.