raster
Fast, functional numerical computing for Clojure/JVM.
Raster brings fast numerical computing to Clojure
Raster is a Clojure and JVM library for numerical computing with typed functions, automatic differentiation, and compilation to the browser and GPU.
What Raster provides
Raster is a library for fast numerical computing on the Clojure JVM. You write math using a deftm macro and get numerical performance close to hand-tuned code, while keeping full REPL interactivity. The library adds automatic differentiation and can compile numerical kernels for the GPU. The promise is that you stay in one language and one workflow instead of dropping into a separate array library or a Python bridge. A notable property is cross-platform reach from a single codebase. The same dot cljc source runs on the JVM and in the browser, with numerical kernels compiled to WebAssembly. The README points to two playable browser demos, Geometric Asteroids and Valley, that run without any install in Chrome or Edge with WebGPU. Those demos are not there only to demonstrate the idea. They are meant to prove that game-loop style code with typed dispatch and parallel primitives works from the same source the library compiles for the server. The project publishes Clojars and CircleCI badges, which tells you it is packaged for the Clojure ecosystem and has continuous testing. For a team already on the JVM, Raster means numerical work no longer forces a second language into the stack, and that is the main reason the author built it.
Core concepts
The README lays out several building blocks. Typed functions come from deftm and ftm, which let you write math that dispatches on value types. Parallel combinators express work that should run concurrently. Polymorphic arithmetic means the same operators apply across the numeric types Raster defines. Automatic differentiation supports forward-mode and reverse-mode passes and a combined value plus gradient form, which is what makes the optimization and deep learning notebooks possible. Compilation is the last piece: Raster turns your typed functions into efficient native or browser code rather than interpreting them. The documentation is delivered as interactive notebooks you open in an editor compatible with Kindly or Clay. Notebooks cover getting started, automatic differentiation, ODE solvers with a Lorenz attractor, linear algebra with LU and Cholesky and SVD, optimization with L-BFGS and Nelder-Mead, deep learning with an MLP, and agent-based modeling compiled for the GPU. There is also a geometric algebra notebook paired with ODE rotors. The breadth of notebooks shows the library is not limited to one kind of math but spans simulation, linear algebra, and learning, all from the same typed-function model. That range is unusual for a JVM numerical library and is the strongest argument for adopting it.
Trying it and performance
The Try It section tells you to clone the repository and start a REPL, then open the notebooks listed above. Because the examples are live, you can modify a kernel and watch the numbers change without leaving the editor. The Why Raster section argues the library is valuable when you want numerical speed but refuse to leave Clojure, and it highlights what the approach enables: a single numerical dialect that serves both server and browser. Performance is presented as a core reason to adopt it, since the compiled kernels avoid the overhead of naive sequence processing. The project links a Slack channel for questions and publishes docs as Clay notebooks on the project site. The game examples, Asteroids and Valley, are offered as proof that procedural generation and parallel primitives compile to WebAssembly and run in a browser from one codebase. For Clojure teams that have avoided scientific computing because the ecosystem felt thin, Raster offers a path that keeps the JVM and adds differentiable, GPU-capable numerics without a second language in the stack. The combination of REPL feedback and compiled kernels is the part the README keeps returning to as the thing that makes the library practical for real work.
Editorial conclusion
Raster is published under the MIT license and targets the Clojure JVM runtime with browser builds through WebAssembly.
Community notes