A programming language for people who want to know what their code is doing.
Statically typed. Explicitly designed. No magic.
use std.runtime;
use print: std.print;
use alloc: std.allocator;
rec Point {
x: f64;
y: f64;
}
fun (this: &Point) magnitude() f64 {
ret sqrt(this.x * this.x + this.y * this.y);
}
$main.symbol = "main";
fun main(argc: i64, argv: &&u8) i64 {
var a: alloc.Allocator = alloc.default();
fin { alloc.allocator_dnit(?a); }
val p: Point = Point{x: 3.0, y: 4.0};
print.printf("magnitude: %f\n", p.magnitude());
ret 0;
}
Mach is built on the belief that clarity is more valuable than cleverness, and that long-term maintainability outweighs short-term convenience.
The compiler, build system, test runner, and dependency manager are a single binary with no external dependencies. No LLVM. No libc. Just mach.
No garbage collector. Allocator types give you structured control over memory with arena and heap strategies. Scope-based cleanup via fin prevents leaks without runtime overhead.
Mutable (*T) and read-only (&T) pointers are distinct types. Functions declare exactly what kind of access they need, and the compiler enforces it.
Query type sizes, alignments, and field offsets at compile time. Conditional compilation lets you write platform-specific code that is fully excluded from the binary when not targeted.
Generic types and functions are fully specialized at compile time. Zero runtime cost, no vtables, no type erasure. You get the code you wrote, and nothing else.
Build, test, and manage dependencies from a single command. The toolchain handles project scaffolding, dependency resolution, and test discovery out of the box.
Mach's backend is designed to be modular and target-independent. New platforms are added without modifying the core compiler.
x86_64
x86_64 / ARM64
x86_64
# Prerequisites: git, make, clang
git clone https://github.com/octalide/mach
cd mach
make full
mach init my-app
cd my-app
mach build .
mach run .