mach

A programming language for people who want to know what their code is doing.

Statically typed. Explicitly designed. No magic.

main.mach
use        std.runtime;
use print: std.print;

fun fib(n: i64) i64 {
    if (n < 2) { ret n; }
    ret fib(n - 1) + fib(n - 2);
}

$main.symbol = "main";
fun main(argc: i64, argv: **u8) i64 {
    print.printf("hello, mach\n");
    print.printf("fib(10) = %d\n", fib(10));
    ret 0;
}

Philosophy

Mach is built on the belief that clarity is more valuable than cleverness, and that long-term maintainability outweighs short-term convenience.

What Mach Is

  • Simple — easy to learn, read, and maintain
  • Explicit — WYSIWYG, always. No hidden behavior, no implicit conversions
  • Opinionated — one way to do things. The right way is the only way

What Mach Is Not

  • Magic — no garbage collector, no hidden runtime, no compiler-inserted behavior
  • A framework — the standard library is building blocks; you compose your program, it won't
  • Permissive — no dialects, no style knobs. One path, by design

Features

Zero-Dependency Toolchain

The compiler, build system, test runner, and dependency manager are a single binary with no external dependencies. No LLVM. No libc. Just mach.

Manual Memory Management

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.

No Hidden Behavior

The runtime, entry point, syscalls, and every allocation are ordinary Mach code you can open and read. The standard library is written in the same language you write — nothing is privileged, nothing is implicit. The program does exactly what its source says.

Compile-Time Introspection

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.

Monomorphized Generics

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.

Integrated Tooling

Build, test, and manage dependencies from a single command. The toolchain handles project scaffolding, dependency resolution, and test discovery out of the box.

Platforms

Mach's backend is designed to be modular and target-independent. New platforms are added without modifying the core compiler.

Available

Linux

x86_64

Planned

macOS

x86_64 / ARM64

Planned

Windows

x86_64

Get Started

1

Install mach

Download the latest release binary, then put it on your PATH.

chmod +x mach
sudo mv mach /usr/local/bin/
2

Create a project

mach init my-app
cd my-app
3

Build and run

mach build .
mach run .