MiloA memory-safe systems language that guides you to correct, readable programs.
Contracts and formal verification are built into the language to help you ship correct code with confidence.
Contracts and formal verification are built into the language to help you ship correct code with confidence.
curl -fsSL https://milo-language.github.io/milo/install.sh | shfn main() {
let name = "world"
print($"hello, {name}")
}fn clamp(x: i64, lo: i64, hi: i64): i64 {
if x < lo { return lo }
if x > hi { return hi }
return x
}fn clamp(x: i64, lo: i64, hi: i64): i64
requires lo <= hi // the caller's obligation
ensures result >= lo && result <= hi // proven, for every input that meets it
{
if x < lo { return lo }
if x > hi { return hi }
return x
}from "std/math" import { Math }
struct Point {
x: f64,
y: f64,
}
impl Point {
fn dist(self: &Self): f64 {
return Math.sqrt(self.x * self.x + self.y * self.y)
}
}
fn main() {
let p = Point { x: 3.0, y: 4.0 }
print($"{p.dist()}") // 5
}fn main() {
let name = "milo"
let greeting = name // `name` moves here. It is no longer yours
print(greeting) // "milo"
print(name) // error: use of moved variable 'name'
}from "std/fetch" import { fetch }
from "std/runtime" import { Promise }
fn main() {
let a = Promise<i32>.run(() => fetch("https://example.com")!.status)
let b = Promise<i32>.run(() => fetch("https://httpbin.org/get")!.status)
print($"{a.await()!} {b.await()!}") // 200 200
}Milo is young - still a puppy 🐶 - but we have built a lot with it already! We dogfood the language by writing a variety of real-world programs to prove it works. This allows for maximum contact with reality, and rapid iteration on things that need improvement. It's ready for you to try today, feedback is appreciated.

A 3D flying game over five real places — SRTM terrain, OpenStreetMap buildings and bridges, aerial imagery draped on top. One analytic sky answers the sky, the distance haze and the sea reflection, so all three agree; the water is raymarched with sun glitter and foam, and the waterfalls have spray and a rainbow at the angle refraction puts one.
⧉ copy run command
Chrome spheres bouncing in a mirrored box — reflections, hard shadows and rigid-body physics, traced per pixel every frame at 60fps. Pure CPU, no GPU.
⧉ copy run command
Unbiased Monte-Carlo global illumination on the CPU. Soft shadows and colour bleed fall out of the bounce integral — nothing is faked.
⧉ copy run commandPosition-Based Dynamics — Verlet point masses woven by distance constraints, the method real cloth engines use. Grab a node and fling it.
⧉ copy run commandA collisionless Vlasov solver in (x, v) phase space — finite-volume MUSCL with Strang splitting, winding a Maxwellian into trapped-particle vortices.
⧉ copy run commandPure-Milo SHA-256, SHA-1, HMAC, JWT, TOTP and Base32 — hashing, MACs and 2FA with no C crypto dependency, matched bit-for-bit to the RFC vectors.
⧉ copy importPure-Milo DEFLATE, gzip, zlib and zip — the codec that gzip HTTP bodies, PNG and git objects need, no C dependency.
⧉ copy import