New library: https://github.com/igrishaev/any. A number of smart objects that equal to what you want. Quite helpful for tests. Sample:
(is (= {:id any/uuid
:name "Some User"
:status :active
:created-at any/Instance}
(get-some-data ...)))
Rationale and more cases are in READMECould you elaborate a bit re: collections being difficult to work with? Couldn't one do something like
(defn seqable-of
[spec]
(any/any [xs "collection of things"]
(every? #(= spec %) xs)))Yeah maybe it sounds a bit unclear. The thing is, Clojure won't let you override = for collections like maps, vectors and so on. You can only control it for ordinary objects
You can however do something like
(defn -coll-of [spec]
(reify
Object
(equals [_ other]
(every? #(= spec %) other))
clojure.lang.IPersistentCollection
(equiv [_ other]
(every? #(= spec %) other))))
(comment
(= (-coll-of 1) [1 1 1]) ; => true
(= (-coll-of 1) [1 1 2]) : => false
*e)Hm, I completely forgot about overriding equiv , that's quite interesting.
(ns repl)
(defn -coll-of [spec]
(reify
Object
(equals [_ other]
(every? #(= spec %) other))
clojure.lang.IPersistentCollection
(equiv [_ other]
(every? #(= spec %) other))))
(def -a-number
(reify
clojure.lang.IPersistentCollection
(equiv [_ other]
(number? other))))
(comment
(= (-coll-of 1) [1 1 1]) ; => true
(= (-coll-of 1) [1 1 2]) ; => false
(= -a-number 1) ; => true
(= -a-number "NaN") ; => false
*e)Yeah, I need to think about it. Maybe it's worth treating each Any object as a collection with custom equiv
we're already in cursed hack land anyway 🙂
How does it compare to matcher combinators?
I don't think you should compare these two. "Any" is just a small trick to keep your tests using = (pure equality check). Matching libraries are usually complex.
tl;dr: if you have a random value in your data, just replace certain fields with any/uuid ,`any/Instant` and this is it.
fwiw, not to "backseat code" but I'd consider something like:
(deftype _Any [repr equality]
Object
(toString [_] repr)
(equals [self other]
(= self other))
clojure.lang.IPersistentCollection
(equiv [_ other]
(equality other)))
(defmethod print-method _Any
[self w]
(.write ^java.io.Writer w (str self)))
(defmacro any
{:clj-kondo/lint-as 'clojure.core/let}
[[other repr] & equality-body]
`(->_Any
~repr
(fn [~other] ~@equality-body)))
to avoid altering print-method at every any callalso if wrapping the body of any in boolean is simply the better idea, why not do it ourselves?
Also interested in how this compares to matcher combinators
inf-clojure 3.4 (aka CIDER Light 😄 ) is out today with many bug fixes and small improvements! See the release notes (https://github.com/clojure-emacs/inf-clojure/releases/tag/v3.4.0) for all the details. inf-clojure doesn't get releases often these days (because it's so great already 😄 ), but it's never forgotten and I always revisit it every now and then. Once again, big thanks to Clojurists Together and everyone else who's supporting my work on Clojure OSS projects! cider ❤️
• https://github.com/clojure/tools.deps.edn 0.9.22 - NEW no-deps library that includes functions split out of tools.deps focused on reading, validating, and manipulating deps.edn files/data, suitable for use if you do that kind of thing but don't want the pile of deps in tools.deps • https://github.com/clojure/tools.deps 0.29.1593 - updated to use tools.deps.edn, some API functions are now deprecated and forward to tools.deps.edn, but should continue to work as it did • Clojure CLI 1.12.4.1607 - updated to use the above, should be no effective changes (but if you see something, please let me know - in particular with local or git deps.edn dependencies)
https://datahike.io/stratum/: a columnar SQL engine for the JVM with git-like branching
We're releasing Stratum — a SIMD-accelerated columnar SQL engine built on the JVM, with copy-on-write branching semantics baked into the storage layer.
What it does:
• PostgreSQL wire protocol — connect with psql, DBeaver, JDBC, psycopg2
• Full analytical SQL: CTEs, window functions, correlated subqueries, PERCENTILE_CONT, APPROX_QUANTILE, full DML
• Fork a dataset in O(1) via structural sharing — no data copied, just a new root pointer
• Time-travel and named branch persistence via konserve
• Datasets implement IPersistentCollection / IEditableCollection — tablecloth and tech.ml.dataset work directly
Why faster than DuckDB on many queries:
Each column chunk carries pre-computed min, max, sum, and count statistics. Unfiltered aggregates like COUNT(*) or AVG(price) on 10M rows are answered from metadata — no row data touched. Predicates and accumulation are also fused into a single SIMD loop via the Java Vector API, eliminating intermediate arrays and second passes.
Single-threaded, 10M rows, JDK 25, Intel Core Ultra 7:
TPC-H Q6 (filter + sum-product) 13ms vs 28ms 2.2x
H2O Q3 (100K string groups) 71ms vs 362ms 5.1x
H2O Q10 (10M groups, 6 cols) 832ms vs 7056ms 8.5x
LIKE '%search%' 47ms vs 240ms 5.1x
Wins 35 of 46 benchmark queries. Full results: https://github.com/replikativ/stratum/blob/main/doc/benchmarks.md
The branching part:
(def experiment (st/fork orders)) ; O(1), shares all unchanged chunks
(
Getting started:
{:deps {org.replikativ/stratum {:mvn/version "0.1.7"}}}
:jvm-opts ["--add-modules=jdk.incubator.vector"
"--enable-native-access=ALL-UNNAMED"]
Requires JDK 21+.
Source: https://github.com/replikativ/stratum
Full write-up: https://datahike.io/notes/stratum-analytics-engine
Part of the replikativ ecosystem alongside Datahike, Proximum, Scriptum, and Yggdrasil — the same CoW branching model across Datalog, SQL, vector search, and full-text.
Would love feedback, especially on the branching use cases and the benchmark methodology.You can run the query engine on direct arrays (double, long, etc.) and on the index https://github.com/replikativ/stratum/blob/main/doc/storage-and-indices.md, which then gives you persistent data structure semantics and optionally durability. Is using JVM arrays what you mean with in memory?
Ah sorry, just hadn't dug in very far. Thanks!
No worries. Lmk if you have any other questions or when you run into issues, it will help me improve it.
Is this in memory?