replikativ / raster
git clone https://github.com/replikativ/raster.git
v0.2.1694 · 2d ago
🔥 on GitHub Trending today
Fast, functional numerical computing for Clojure/JVM.
+0
stars, 24h · #15,513
+1
stars, 7 days · #15,805
+~0
stars, 30 days · #22,392
66
★ total · +1% this week
3
forks · 4 open issues
Star history (as recorded here)
LanguageClojure
LicenseMIT
Created2026-03-10 (7mo ago)
Last push1d ago
Watchers0
OwnerOrganization
Seen on GitHub Trending
- 2026-10-21 — #4 weekly in clojure · +1 ★
- 2026-10-20 — #4 weekly in clojure · +1 ★
Links
README excerpt
# Raster **Fast numerical computing for Clojure.** Write math with `deftm`, get world-class numerical performance on the JVM — with full REPL interactivity, automatic differentiation, and GPU compilation. [code] ## Try It 🎮 **Play the live demos — no install** (WebGPU, Chrome/Edge): **Geometric Asteroids** · **Valley** — both run from one `.cljc` codebase with the numerical kernels compiled to WebAssembly. To explore the library itself: [code] Then open one of the interactive notebooks in your editor (Kindly/Clay compatible): | Notebook | What you'll learn | |----------|-------------------| | Getting Started | `deftm`, typed dispatch, value types | | Automatic Differentiation | Forward-mode, reverse-mode, `value+grad` | | ODE Solvers | Lorenz attractor, adaptive solvers, events | | Linear Algebra | Vec/Mat types, LU, Cholesky, SVD | | Optimization | L-BFGS, Nelder-Mead, Newton's method | | Deep Learning | MLP training with compiled AD | | Agent-Based Modeling | Endogenous firm formation, GPU-compiled | | Geometric Algebra + ODE | Rotors, precession | ### Game Examples Playable demos of typed dispatch, parallel primitives, and procedural generation: | | | |---|---| | | | ▶ Play in the browser: **Asteroids** · **Valley** (WebGPU — Chrome/Edge). - **Geometric Asteroids** — polygon shapes via `defvalue` + `deftm` dispatch; add new shape types from the REPL during gameplay. Cross-platform from one `.cljc` codebase: runs on the JVM (Vulkan) and in the browser (WebGPU, physics compiled to WebAssembly). - **Valley** — a streaming voxel world (biome terrain, caves, ore veins, trees, day/night sky, skylight + glowstone block-light, water, passive mobs, mining). Also cross-platform: the same kernels compile to JVM bytecode + Vulkan and to WebAssembly + WebGPU. There's also a Doom-style renderer (WAD loading + BSP traversal, WIP). See examples/README.md for running instructions. ## Cross-platform: one codebase, JVM and the browser The two games above run from one Clojure(Script) source on two very different targets — desktop (JVM + Vulkan) and the browser (WebAssembly + WebGPU). What makes that work is that the two *performance-critical* layers compile to native code on **each** platform: - **Numerical kernels (`deftm`/`defvalue`) → JVM bytecode _and_ WebAssembly.** The terrain noise, biome/cave generation, and AABB + batch physics are written once as typed functions over primitive arrays and value types. `compile-aot` turns them into primitive JVM bytecode (no boxing) on the desktop and into an **f64 WebAssembly module** (via `raster.compiler.cljs-emit`) in the browser — so you don't rewrite the hot math in JS, Rust or C for the web. The same `deftm` kernels run native on both. `defvalue` value types (e.g. `Shape`, `Vec3`) stay unboxed and marshal across the wasm boundary as flat structs. - **Rendering (`raster.render`) → Vulkan _and_ WebGPU.** Both games draw against one small renderer protocol, and one shader description emits both GLSL (