Interactive notebooks (Kindly/Clay compatible) are in notebooks/raster/.
Run them with Clay:
(require '[scicloj.clay.v2.api :as clay])
(clay/make! {:source-path "notebooks/raster/getting_started.clj"})| Example | Description |
|---|---|
| LeNet-5 | Compiled CNN on MNIST |
| GPT-2 | Transformer language model |
| BERT | Masked language model |
| Matrix Factorization | Collaborative filtering |
Also: Reaction-Diffusion — Gray-Scott pattern formation.
| Example | Description |
|---|---|
| Asteroids | Geometric Asteroids — polygon shapes via defvalue/deftm; cross-platform |
| Doom | WAD renderer — BSP, sprites, HUD (WIP) |
| Valley | Streaming voxel world — biome terrain, caves, ores, trees, lighting, water, mobs; cross-platform |
Asteroids and Valley are cross-platform: one .cljc codebase runs on the JVM
(Vulkan + deftm→bytecode) and in the browser (WebGPU + deftm→WebAssembly). See
asteroids/web/README.md for the browser builds.
clojure -Sdeps '{:paths ["src" "examples"]}' -M:vulkan -m <entry-point>Entry points:
- Asteroids (Vulkan):
-m asteroids.vk-main— or-m asteroids.jvmfor a no-native-deps Swing window - Doom:
-m doom.run - Valley (Vulkan):
-m valley.vk-walk
(The :vulkan alias pulls in the LWJGL dependencies. The Valhalla JDK is optional —
needed only for the Dual4 value-type fast paths, not for the games.)
The games are built on raster.vk.*, a data-oriented Vulkan wrapper via LWJGL:
raster.vk.gpu— GPU context (instance, device, queues, allocator)raster.vk.frame— fixed-timestep game loop with compute/render phasesraster.vk.pipeline— graphics pipeline constructionraster.vk.texture— image loading and sampler managementraster.vk.mesh— vertex/index buffer managementraster.vk.input— keyboard/mouse via GLFWraster.vk.audio— positional audio via OpenAL
Valley also uses raster.noise for procedural terrain generation (Perlin noise,
FBM, ridged noise — implemented with deftm for typed dispatch).