$ statically-typed · compiled · gpu-first

Miri: GPU-first
programming language

Write GPU kernels in the same statically typed language as your CPU code. Mark a binding gpu, launch it with forall, and the compiler infers every upload, launch and readback. Host code compiles to native machine code. Kernels compile to WGSL for Metal, Vulkan, DX12 and WebGPU.

SCROLL ▾
01 / THE LANGUAGE

See Miri in action

Clean syntax, powerful features, zero boilerplate. Pick a topic — every sample is real, runnable Miri.

hello.mi
02 / FEATURES

Built for the future

A modern language designed from the ground up.

GPU-First Programming

GPU kernels live alongside CPU code in the same language — no shader files, no FFI. Mark a binding gpu, launch with forall, and every upload, launch, and readback is visible in the source. Runs natively and in the browser via WebGPU.

AI-Assisted Development

Diagnostics come as JSON with a stable code and a help line, and miri fix applies the recorded repairs for you. Your coding agent reads the error and knows exactly what to change. Miri for agents →

Memory Safety

Invisible ownership with optimized reference counting. Copy-on-Write collections give value semantics with reference-pass speed. The only memory keyword you ever write is out.

Native Compilation

Compiles to native machine code via Cranelift. Fast compilation, fast execution, small binaries.

Static Typing & Type Inference

Catch errors at compile time with a powerful type system that stays out of your way. Types are inferred where possible.

Testing Built In

Mark a function @test and run miri test — each test runs in its own subprocess, so a crash is a failure rather than a lost run. Attributes are a closed set, so a typo is a compile error, never a test that silently never runs.

And everything else a modern language owes you

  • Clean syntax — indentation-based blocks, no braces, no semicolons.
  • Pattern matching — exhaustive, with destructuring and guard clauses.
  • Null safety — T? marks a value that may be absent, and the compiler makes you check it.
  • Traits & generics — default methods, monomorphized at compile time.
  • Classes & inheritance — constructors, visibility, abstract classes, virtual dispatch.
  • First-class closures — capture by value; pass, store and return them.
  • Batteries-included standard library — files, time, regex and JSON. Disk access is a capability you pass in, and nothing panics.
  • Async & parallelism coming soon — async/await and parallel primitives.
03 / FOR CODING AGENTS

Let your agent write it

Claude Code, Cursor, Codex and friends can write Miri from day one. The compiler tells them exactly what went wrong and how to fix it, and skill packs teach them the language.

terminal
# once: build the compiler and put it on PATH
git clone https://github.com/miri-lang/miri.git
cd miri && make install

# in your project: give your agent the skill packs
miri skill install
  • Errors an agent can act on. miri check --format json gives every problem a stable code, its exact place, a one-line fix hint and often the edit itself.
  • Fixes in one call. miri fix --apply writes the edits the compiler is sure of.
  • No guessing names. miri view --type List lists what a type really offers.
  • Tests it can read. miri test --format json reports expected and actual values for every failure.
05 / OVERVIEW

What is Miri?

Miri is a statically typed, natively compiled programming language with first-class GPU programming built into the language rather than bolted on through a library. You mark data gpu to make it device-resident and launch a kernel with forall. The compiler infers every upload, launch and readback. 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 CUDA toolchain.

Miri logo

Start writing Miri