clojure 2026-06-16

Probably stupid question but for hash table, have we considered elastic hashing? https://youtu.be/EdVG5qNm2rY?si=UnIlOf9Cw4L8iedE

The structure of mutable hash tables is usually going to be very different in memory from immutable ones

Immutable hash "tables" to achieve good performance need structural sharing, and to git structural sharing you need a tree of nodes in memory

Lots of mutable hash tables are basically flat arrays, and you use modulus of the hash in some way to pick a location in the array

So fundamentally different structures and you are going to use different algorithms

Short answer: this type of hashing improvement is only relevant for very large and dense hashtables (think 95% occupancy). Useful for some narrow set of tasks, but not really in the general-purpose sense. And then, it comes with its own set of tradeoffs, so it is not strictly better to be a no-brainer upgrade.

I've noticed that I can type hint the return value of a protocol method, but I need to use the full class and package name, even if I import the class. i.e.

(ns example.core)

(defprotocol Foo
  (foo ^java.io.InputStream [_]))
Will work in all cases, but if I use:
(ns example.core
  (:import [ InputStream]))

(defprotocol Foo
  (foo ^InputStream [_]))
This version will not work if I reference the foo protocol method in another namespace. Is there a reason for this behavior, or is it a bug?

Alex Miller (Clojure team) 2026-06-16T11:41:01.900159Z

It's a bug and we have a fix in the queue for 1.13

👍 2
👍🏻 1