$ 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.

Clean Syntax

Indentation-based blocks, no braces or semicolons. Balanced readability, expressiveness, and safety.

AI-Assisted Development

Designed with clear, consistent semantics that make AI code generation and assistance highly effective.

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.

Native Compilation

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

Pattern Matching

Exhaustive pattern matching with destructuring across enums, structs, tuples, and literals. Guard clauses included.

Option Types & Null Safety

The ? type suffix marks values that may be absent. The compiler prevents use without checking — no null pointer errors.

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.

Classes & Inheritance

Full OOP with constructors, visibility modifiers, single inheritance, abstract classes, super calls, and runtime virtual dispatch via vtables.

Traits & Generics

Trait interfaces with default methods and inheritance chains. Generic functions, structs, and classes monomorphized at compile time.

First-Class Closures

Lambdas that capture variables by value. Pass them as arguments, store in variables, return from functions. Compiled to native fat pointers.

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.

Batteries-Included Standard Library

Files, the environment, time, regular expressions and JSON, alongside the collection types. Access to the outside world is a capability you pass in, so a function that cannot touch the disk says so in its signature. Nothing panics, and nothing hands back a sentinel.

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.

COMING SOON

Async & Parallelism

First-class async/await and parallel primitives make concurrent programming intuitive and safe.

04 / 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