Miloworks hard to keep your memory safe so you don't have to
Safe systems programming language with formal verification built-in
Safe systems programming language with formal verification built-in
Milo is a memory-safe systems language that guides you to simple, correct, readable programs. Contracts are built in, enabling formal verification that guarantees correctness across your codebase, no matter how large. People and AI ship with confidence that their code is correct. Learn more or see how it measures up to Rust.
fn 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 { sqrt }
struct Point {
x: f64,
y: f64,
}
impl Point {
fn dist(self: &Self): f64 {
return 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/net" 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
}We build the language by building things with it. We dogfood Milo to get a feedback loop that helps us continuously improve the safety and ergonomics of the language.
Pure-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
The classic, in your terminal.
⧉ copy run commandA live htop-style view of your machine.
⧉ copy run commandTwo commands side by side in real PTYs — a mini tmux.
⧉ copy run commandMilo's own package manager. Install and publish packages over git.
⧉ copy run command