Miri is a statically typed, natively compiled programming language with first-class GPU programming: mark data gpu, launch with forall, no CUDA toolchain.
GPU code is written in the same language as the host code that calls it. You mark data gpu to make it device-resident and launch a kernel with forall; the compiler infers every upload, launch and readback, and shows them at the binding site. Kernels compile to WGSL and run on Metal, Vulkan, DX12 and WebGPU. Host code compiles to native machine code through Cranelift. There are no shader files, no FFI layer, and no separate host/device build.
gpu let a = [1.0, 2.0, 3.0, 4.0]
gpu let b = [5.0, 6.0, 7.0, 8.0]
gpu var dst = [0.0, 0.0, 0.0, 0.0]
forall i in 0..a.length()
dst[i] = a[i] + b[i]
let host = dst // the only boundary crossing: assignment = readback
println(f"{host[0]} {host[1]} {host[2]} {host[3]}") // 6.0 8.0 10.0 12.0
▶ Run eight GPU demos live in your browser → — a gravitationally-lensed black hole, a traversable wormhole, a 147k-particle flow field, a fluid solver, and a neural net training on the GPU. Each one is a real Miri program compiled to WebGPU; the page runs the compiler's own output.
| Repository | What it is |
|---|---|
| miri | The language and compiler — frontend, type checker, MIR, Cranelift and WGSL backends, standard library. |
| miri-lang.org | The website: documentation, the language and GPU guides, and the live demos. |
| vsc-extension | Visual Studio Code extension — syntax highlighting and editor support. |
- Getting started — install the compiler, write
hello.mi, tour the language. - GPU programming guide — residency,
forall, on-device reduction, shared memory, atomics, interactivegpu frameloops. - GPU playground — every demo with its full source.
Miri is a standalone language and compiler with its own syntax, type system and toolchain. It is in beta and not production ready — the current release is v0.5.0-beta.3, there are no prebuilt binaries yet, so you build it from source, and each release records what changed. Apache-2.0.