Core interop round 4: read-eval, j.u.c construction, prefix lists, dotted protocol names - #703
Merged
Merged
Conversation
added 7 commits
August 22, 2026 13:39
The clojure reader's EvalReader: #=form reads its form and evaluates it on the spot (clj-uuid computes its bit masks with #= about twenty times), refusing under (binding [*read-eval* false] ...) with the JVM's message. EDN still has no = dispatch. The eval entry point and the var cell live in later-loaded files and resolve at call time; a load interleaves read and eval per top-level form, so earlier requires are visible to a #= in a later form. The known divergence entry for '#= is inert data' is retired (jolt-o3sw.10).
The shapes Grain's SQLite write coordinator constructs directly. ArrayBlockingQueue is a real bounded blocking queue (offer/put/take/poll with the timed variants, fiber-aware through jolt-cv-wait; take answers (v . #t) internally so a false element stays distinct from a timeout). FutureTask is a run-once task with a blocking get; cancel wins only before run starts (the JVM can interrupt a running task, jolt cannot). The ThreadPoolExecutor ctor builds on make-executor, sized by maximumPoolSize, keepAlive/factory/handler accepted and ignored; submit/execute route a FutureTask through its own run. .getQueue answers a live VIEW of the executor's internal queue — real depth, capacity from the ctor's queue argument — because tasks flow through the executor's own unbounded queue: the JVM rejects a submit when the bounded queue fills, jolt queues it, and that is the documented divergence. 12 corpus rows certified on OpenJDK 20 (jolt-o3sw.9).
[clj-uuid [bitmop :as bitmop] [clock :as clock] ...] is a prefix list on the JVM — a vector is a single libspec only when its second element is a keyword or absent. The old single-libspec read required the PREFIX itself, which for clj-uuid meant a silent self-require mid-load with every sub-spec and alias dropped, and 'Unknown class bitmop' at the first qualified call. The expansion now lives in ns.ss (expand-libspec) shared by the loader's expand-spec, the build driver, and compile-eval's alias pre-scan — the pre-scan and the gates' alias-only require missed prefix lists in both spellings before this.
The constants ARE the charset name strings, which every jolt charset seam (.getBytes, String ctors, stream readers) takes — so the constant composes with all of them. clj-uuid's v3/v5 digest path calls (.getBytes s StandardCharsets/UTF_8).
A deftype/reify may name a protocol by its class — mulog's ConsolePublisher implements com.brunobonacci.mulog.publisher.PPublisher — and the JVM resolves that to the protocol. protocol-key-of only tried the symbol as a var reference, so the dotted spelling filed the methods as interface methods and protocol dispatch answered 'No method publish-delay'. On a miss it now reads the last segment as the name and the demunged prefix as the namespace and looks the protocol var up there. Found running mulog under jolt-o3sw.12.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reopened against
main— this was #701, which GitHub closed when its base branch was deleted on #697's merge. Same commits, same validation.Round 4 of the Grain gap audit (epic jolt-o3sw). Four gaps, two of them general bugs that real libraries hit:
#=read-eval, gated by*read-eval*as on the JVM (EDN still rejects it). clj-uuid uses about twenty of them.java.util.concurrentconstruction —ArrayBlockingQueue,FutureTask,ThreadPoolExecutor. The machinery existed; only the constructors were missing.getQueuereturns a real depth view. One documented divergence: a full queue blocks rather than rejecting, since jolt models no rejection policy.(:require [clj-uuid [bitmop :as bitmop]])was read as a self-require and silently dropped every alias in the list — the list spelling worked, the vector spelling did not. Fixed in the one shared expander so the loader, the analyzer, and the corpus environment's alias-only path all agree.(deftype T [] my.ns.PThing (m [_] …))) resolves to the protocol like the JVM. The methods used to file as interface methods and dispatch answered "No method …". Found running μ/log's publishers.Plus
java.nio.charset.StandardCharsets.Validation
certifygatemake testgreen, 0 new divergencesmake gambitgenre-run for the records change;gambitseedcheckpasses