datahike

whilo 2026-04-13T00:27:38.845239Z

https://github.com/replikativ/raster 0.1.1 — Fast numerical computing for Clojure I'm happy to announce the first public release of Raster, a library for numerical and scientific computing on the JVM. The core idea: write math with deftm (typed multi), get Julia/JAX-level performance — with full REPL interactivity. What it does deftm gives you typed multiple dispatch (inspired by Julia). The compiler resolves dispatch at definition time, emits JVM bytecode, and fuses array operations across function boundaries:

clojure
(deftm relu [xs :- (Array double)] :- (Array double)
  (par/map [i (alength xs)]
    (Math/max 0.0 (aget xs i))))
par/map, par/reduce, and par/scan are parallel combinators (inspired by Futhark). The compiler treats them as first-class IR nodes, fuses producer-consumer chains (SOAC fusion), and lowers them to SIMD loops or GPU kernels — from the same source. compile-aot inlines an entire call chain — forward pass, reverse-mode AD, optimizer update — into a single JVM method. Zero heap allocations in the hot path. Performance All on Valhalla JDK 27, single-threaded CPU:
| Workload                        | Raster | Reference                             |
|---------------------------------|--------|---------------------------------------|
| ODE solve (DP5 Lorenz)          | 432 us | Julia 583 us — 1.4x faster            |
| LeNet-5 train step (f32)        | 148 us | JAX 356 us — 2.4x faster              |
| LeNet-5 train step (f64)        | 222 us | JAX 370 us — 1.7x faster              |
| MLP train step (f64)            | 136 us | JAX 86 us — JAX 1.6x faster           |
| AD sensitivity (Lotka-Volterra) | 15 us  | Julia ForwardDiff 16 us — 1.1x faster |
The DL numbers include the full compiled pipeline: forward, backward (reverse-mode AD), and SGD update. What's included - Typed multiple dispatch with Julia-style method specialization - Forward-mode and reverse-mode automatic differentiation - Nanopass compiler with SOAC fusion, buffer fusion, SIMD vectorization - ODE/PDE/SDE solvers (Euler, RK4, DP5, Tsit5, Rosenbrock) - Optimization (L-BFGS, Nelder-Mead, Newton) - Linear algebra with LAPACK via Panama FFI (SVD, QR, eigendecomposition, Krylov methods) - Deep learning layers (linear, conv1d/2d, attention, normalization) with compiled training - GPU backends (OpenCL, Level Zero, Vulkan compute) - Symbolic computation, geometric algebra, agent-based simulation - Interactive notebooks (Clay/Kindly) Try it
bash
git clone 
cd raster && clojure -M:nREPL
Then open one of the notebooks: getting started, autodiff, ODE solvers, linear algebra, optimization, or deep learning. Requires JDK 24+ (ClassFile API, Panama FFM). Valhalla JDK 27 recommended for best performance. GitHub: https://github.com/replikativ/raster Docs / Notebooks: https://replikativ.github.io/raster/ Slack: #simmis on Clojurians Feedback, questions, and bug reports very welcome.

🔥 2
whilo 2026-04-13T02:30:42.792089Z

The Valley game example uses Datahike for game state with specialized fast-transact to minimize write latency inside simulations https://github.com/replikativ/raster/blob/main/examples/valley/state.clj#L73. This now makes it possible to build complex simulations on the persistent memory model of Datahike, including git-like branches and game resets. You can for instance send the game state snapshot at any point to another game and reset it on the fly.

🔥 1