This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-16
Channels
- # announcements (62)
- # babashka (12)
- # babashka-sci-dev (73)
- # beginners (16)
- # biff (10)
- # calva (65)
- # cider (13)
- # clerk (8)
- # clojure (31)
- # clojure-europe (16)
- # clojure-nl (1)
- # clojure-norway (19)
- # clojure-spec (24)
- # clojure-uk (5)
- # clojuredesign-podcast (18)
- # clojurescript (18)
- # dev-tooling (2)
- # emacs (30)
- # etaoin (4)
- # gratitude (3)
- # hyperfiddle (20)
- # integrant (2)
- # jobs (4)
- # kaocha (7)
- # malli (1)
- # observability (11)
- # off-topic (11)
- # pathom (12)
- # podcasts-discuss (7)
- # portal (12)
- # quil (3)
- # re-frame (6)
- # releases (1)
- # sql (22)
- # squint (5)
- # testing (79)
- # tools-deps (3)
- # xtdb (20)
Anyone has experience with using JAR layering for OCI images with Clojure? https://github.com/albertattard/presentation-layered-jar/tree/master/examples/clojure-layered-jar is the only example I could find and it doesn't seem to be up-to-date (3y)
I don't know anything about the topic, but 3 years doesn't sound that long at all. Does the example not work?
given a counted?
thing (a result from https://docs.datomic.com/pro/clojure/index.html#datomic.api/qseq in our case), what’s the easiest way to return a new thing that does a lazy transformation (map transform-fn counted-thing)
that’s also counted?
.
Lazy stuff is usually not counted so probably no easy way
could probably hack something together with deftype
, but then you'd have to reimplement all of the core features you want to support, which is a real pain in the butt
user> (def data [1 2 3 4 5])
#'user/data
user> (lznc/map #(+ % 2) data)
[3 4 5 6 7]
https://cnuernber.github.io/ham-fisted/ham-fisted.lazy-noncaching.html#var-mapThis seems pretty suspicious - chunkIteratorSeq does not produced a chunked seq....
user> (def al (hamf/array-list (range 200)))
#'user/al
user> (type al)
java.util.ArrayList
user> (chunked-seq? (seq al))
false
user> (instance? java.lang.Iterable al)
trueSyntax error reading source at (REPL:65:41).
Unmatched delimiter: )
user> (instance? java.lang.Iterable al)
true
user> (chunked-seq? (clojure.lang.RT/seq al))
false
user> (chunked-seq? (clojure.lang.RT/chunkIteratorSeq (.iterator al)))
false
user> (type (clojure.lang.RT/chunkIteratorSeq (.iterator al)))
clojure.lang.LazySeq
Before you respond that it doesn't matter because the first chunk of the chunkIteratorSeq is an actual chunk - here is the definition of map and there are similar definitions for filter, etc across clojure.core -
([f coll]
(lazy-seq
(when-let [s (seq coll)]
(if (chunked-seq? s)
(let [c (chunk-first s)
size (int (count c))
b (chunk-buffer size)]
(dotimes [i size]
(chunk-append b (f (.nth c i))))
(chunk-cons (chunk b) (map f (chunk-rest s))))
(cons (f (first s)) (map f (rest s)))))))
So if you are working with literally any java.util datastructure the performance of any clojure.core function is somewhat unnecessarily hampered.Can you put it on Ask Clojure?
https://ask.clojure.org/index.php/13471/rt-chunkiteratorseq-does-not-produce-a-chunked-seq
Does anyone know the status of spec2? I find the idea of separating the schema of the data from it's various usages via a selector really interesting, but it seems like it's sort of stalled out? The original spec was also alpha, but bundled with Clojure core. Is spec2 in a similar state of usability, or is it significantly less stable? Is there any (rough) timeline for when spec2 will supercede the original? Any specific major hurdles that are preventing it from getting there?
spec2 is effectively paused and has not had a release (there are known bugs/unfinished parts to it)
in the spec multiverse, I'm not sure which timeline we are on wrt a future release
Will spec be abandoned with high enough probability to consider using spec1 and spec2 as not good idea anymore? It gives such feeling a little. I don’t know how to give this question in other way 🙂
Many people are using spec1 now, and certainly we are not going to take that away. I don’t have a future plan for spec2 - it’s not something we are actively developing at this moment. I consider it “paused” rather than “abandoned”.
There are many such things in our past dev, we just didn’t make most of them public :)
We were last working on integration of specs with defn. Despite trying many such things we never got to a design we were happy with.
I think my preferred path would be to finish the unfinished work on what exists (which includes a lot of good stuff) and do the integration work to include it in Clojure, saving the defn stuff for the future.
Would be cool if the Clojure team shared their experiments and explained why the options they tried are not satisfying
I see. Thanks @U064X3EF3
it would be cool, but there are only so many hours in the day :)