Skip to content

Minimalism pass: drop diff, dead code, CLJS, and the Datomic comparison - #1

Open
maxweber wants to merge 4 commits into
mainfrom
minimalism
Open

maxweber wants to merge 4 commits into
mainfrom
minimalism

Conversation

@maxweber

Copy link
Copy Markdown
Owner

Summary

Applies the same minimalism steps as dbval's conn-without-atom PR (the parts that are about removing code — the conn/deftype architecture changes were not ported, see below). Net: −3,220 lines, three dependencies dropped.

Drop clojure.data/diff + Tier 1 dead code

  • diff-similar now throws: a diff would have to realize both (potentially larger-than-memory) databases. The extension is kept only so diff doesn't fall back to diffing the record's fields. Its comparators were also silently broken — they still compared UUID entity ids with Integer/compare.
  • Removed: query_v3 (~1,000 lines), the datom comparators (cmp-datoms-*, defcomp, combine-cmp, diff-sorted), case-tree/case-pick/vpred, dead -search bindings, the mutable idx field on Datom, the broken core/settings.
  • Dependencies: nippy (never used) and persistent-sorted-set (its array helpers are now the 20-line slateval.arrays).

Tier 2 compat shims

tempid/resolve-tempid removed (hollowed out by UUID ids; no callers); the duplicate Datascript squuid removed — ids come from com.yetanalytics/colossal-squuid via gen-id. d/db and d/transact stay.

ClojureScript/JS removal

The storage layer is SlateDB via JVM uniffi bindings, so the disabled CLJS variant can't work without a different backend. All #? reader conditionals stripped, every .cljc.clj, slateval.js/deps.cljs/externs.js/release-js//test/js/ deleted, the CLJS-only macro layer (defn+, if-cljs, patch-tag) removed (defrecord-updatable keeps its JVM implementation), :cljs alias and transit-cljs dropped.

Bench refactor, Datomic comparison dropped

bench_datomic/, test_datomic/, the :datomic alias and datomic peer dependency are gone. The runner is now slateval.bench.run (via script/bench.sh), adapted to UUID ids and strict snapshots: transaction benches replay against a fresh store per iteration; one-tx-per-op benches use a 100-people dataset since a SlateDB commit flushes durably (~100ms each); read benches build a 20k store once. All bench categories smoke-tested.

Bugfix found by the bench: storing an empty vector as a value NPEd in tuple (& rest args are nil for zero components, Tuple.addAll requires a List). Fixed with a regression test.

Not ported (deliberately)

dbval's conn-is-not-an-atom redesign, the DB/FilteredDB deftype conversion, and reference-identity semantics. slateval's as-of/since/history/with-dry-run features are built on the record shape and snapshot semantics, so that's a separate decision with its own review.

Test plan

  • Baseline on main: 159 tests, 1045 assertions, 0 failures.
  • After each milestone commit the suite stays green; final: 158 tests, 1033 assertions, 0 failures (tests removed alongside deleted features: query-v3, squuid; one added: empty-vector regression).
  • datafy/pprint load-checked (not covered by the suite); every bench category smoke-tested.

🤖 Generated with Claude Code

https://claude.ai/code/session_014dX8tTR4yFh5SyBGw3atpo

maxweber and others added 4 commits July 15, 2026 11:15
Mirrors the dbval minimalism pass:

- `clojure.data/diff` would have to realize both databases entirely in
  memory; the `Diff` extension now throws an informative exception (and
  is kept only so diff does not fall back to diffing the record fields).
  Its comparators were also silently broken: they still compared UUID
  entity ids with `Integer/compare`.
- Remove `query_v3`, the datom comparators (`cmp-datoms-*`, `defcomp`,
  `combine-cmp`, `diff-sorted`, `cmp`, `value-cmp`), `case-tree`/
  `case-pick`/`vpred`, the dead `-search` bindings, the mutable `idx`
  field on `Datom`, and the broken `core/settings`.
- Drop `nippy` (never used) and `persistent-sorted-set` (its array
  helpers are now the tiny `slateval.arrays` namespace).
- `empty-db` docstring now documents `:db-file`/`:object-store-url`
  instead of persistent-sorted-set options.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
`tempid` and `resolve-tempid` had no callers; `d/db` and `transact`
stay. The Datascript `squuid` implementation is removed — entity and
transaction ids use com.yetanalytics/colossal-squuid (`gen-id`).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The storage layer is SlateDB via its JVM uniffi bindings, so the CLJS
variant (disabled since the fork) cannot work without an entirely
different backend; git history keeps it recoverable.

- Delete `slateval.js`, `deps.cljs`, `externs.js`, `release-js/`,
  `test/js/`, `slateval.test.cljs` and the cljs/js test+bench scripts.
- Strip every `#?`/`#?@` reader conditional (keeping the :clj branches)
  and rename all `.cljc` sources and tests to `.clj`.
- Remove the CLJS-only macro layer: `defn+` (now plain `defn`),
  `if-cljs`, `cljs-env?`, `patch-tag`; `defrecord-updatable` keeps only
  its JVM implementation.
- Drop the :cljs alias and transit-cljs from deps.edn.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Remove `bench_datomic/`, `test_datomic/`, the :datomic alias and the
  datomic peer dependency, plus the wrapper scripts. `script/bench.sh`
  replaces bench_clj/bench_all; test_all.sh is gone — CI runs
  `test_clj.sh` directly.
- Rename the runner to `slateval.bench.run` and adapt it to the
  SlateDB/UUID/strict-snapshot world: transaction benches replay against
  a fresh store per iteration with `*batch*` 1 (one-tx-per-op benches use
  a 100-people dataset — a SlateDB commit flushes durably at ~100ms);
  read benches build a 20k store once; entity lookups use sampled UUIDs
  and lookup refs; freeze/thaw dropped (jsonista/cheshire removed).
- Bugfix found by the bench: storing an empty vector as a value NPEd in
  `tuple` (& rest args are nil for zero components, Tuple.addAll
  requires a List). With regression test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant