Validated on real codebases
-O2Validated on real codebases
A single executable that cross-compiles to all targets from any platform.
C-like syntax with modern conveniences. Function overloads, type inference, generics, struct literals, defer, slices, named arguments.
struct Rect { i32 x, y, w, h; } bool contains(Rect r, i32 px, i32 py) { return px >= r.x && px < r.x + r.w && py >= r.y && py < r.y + r.h; } i32 main() { print("Hello, world! 🎉\n"); var box = Rect{ x: 0, y: 0, w: 64, h: 48 }; print("hit = {}\n", contains(box, px: 10, py: 20)); return 0; }
The entire compiler self-compiles (~100k lines) to 1.9 MB, with no external dependencies.
No runtime, instead calls directly into kernel32.dll on Windows, raw syscalls on Linux, and libSystem.B.dylib on macOS/iOS.
On WebAssembly, a tiny stdlib shim provides core functionality.
Compile times are instant (milliseconds) for small to medium-sized projects.
// Cross-compiler + all targets: ~1950 KB
$ minc run hello.mc
-> hello.exe (2.5 KB) (10 lines) // 20 ms
Hello, world! 🎉
$ minc sokol_cube.mc
-> sokol_cube.exe (191.0 KB) (124,365 lines) // 200 ms
A single executable generates Windows, Linux, macOS, iOS, Android and WASM binaries directly. No external assembler or linker needed. Cross-compile from any platform to any target. macOS adhoc codesigning built-in.
JIT module - recompile code with libminc.{dll/so} and hot-swap binaries with a cross-platform API.
// Cross-compile from any platform: $ minc app.mc --target win-x64 // Windows PE $ minc app.mc --target linux-x64 // Linux ELF $ minc app.mc --target macos-arm64 // macOS Mach-O $ minc app.mc --target wasm // WebAssembly // Launches built-in webserver and runs WASM // --shader-live enables shader live edits $ minc run --target wasm --shader-live app.mc // Same source, same compiler, any target.
Generics, tagged unions with exhaustive pattern matching, type aliases, auto-deref, type inference, function overloading, named arguments, destructuring, range-based for-loops, compile-time format strings, and a module system. Enough modern conveniences to stay productive without the complexity.
union Result<T, E> { Ok(T), Err(E) } // tagged union var p = Point{3, 4}; // type inference var (x, y) = get_pos(); // destructuring node.next.value; // auto-deref (no -> needed) draw(width: 800, height: 600); // named arguments for i in 0..n { sum += data[i]; } // range-based for print("{} + {} = {}\n", a, b, a+b); // compile-time T max<T: Numeric>(T a, T b) { // constrained generic return a > b ? a : b; }
Vector and matrix types — float4, float4x4, f64x2 —
are first-class types, not library wrappers. Arithmetic on them
lowers to native SIMD instructions (SSE/NEON/WASM-SIMD) on every supported target.
// Built-in vector and matrix types float4 pos = float4{x, y, z, 1.0}; float4x4 mvp = proj * view * model; // Arithmetic lowers to SIMD (SSE/NEON/WASM-SIMD) float4 clip = mvp * pos; float4 lit = color * light + ambient; f32 d = dot(a, b); float4 n = normalize(v); // Same types used in shaders (@shader) and CPU code.
Write shaders in minc syntax with @shader annotations.
The compiler translates them to GLSL, HLSL, or Metal depending on
the target API. No separate shader toolchain or offline
compilation step.
Shader live reloading - edit shader while your app is running and see changes directly on file edits. File change API is completely cross-platform.
struct VsOut { float4 pos; float4 color; } @shader vertex VsOut cube_vs( @attr(0) float4 position, @attr(1) float4 color, @uniform float4x4 mvp ) { VsOut o; o.pos = mul(mvp, position); o.color = color; return o; } @shader fragment float4 cube_fs(VsOut input) { return input.color; }
No arithmetic or indexing undefined behavior. Bounds-checked arrays, wrapping arithmetic, mixed signed/unsigned rejected at compile time, and explicit casts for lossy conversions. Defer for deterministic cleanup. Compile-time format strings that can't crash at runtime. Built-in atomics, threads and cooperative fibers.
// Defer: deterministic LIFO cleanup var fd = open("data.bin", 0); defer close(fd); var buf = alloc<u8>(4096); defer free(buf); // both freed in reverse order at scope exit // signed overflow wraps, no UB i32 x = 0x7FFFFFFF + 1; // Cooperative fibers void producer(void* arg) { print("step 1\n"); fiber_yield(); print("step 2\n"); } // Threads: built-in, no external library var t = thread_create(worker, arg); thread_join(t);
Call C functions directly with extern declarations — no import
libraries and no .def files, even for the Windows API. Link COFF, ELF,
and Mach-O objects directly, or let a library bundle its own C shim. minc functions
can be passed back to C as callbacks too — the C ABI is applied automatically.
// Call C directly: no import libs, no .def files. when os(windows) { extern "user32.dll" i32 MessageBoxW(void* hwnd, u16* text, u16* title, u32 flags); } when os(linux) { // block form: one lib, many fns extern "libm.so.6" { f64 sin(f64 x); f64 cos(f64 x); } } // A library can carry its own C shim — the @link tag // follows the #include, so `minc app.mc` just works: // lib/audio.mc: @link "audio_shim.obj" #include "lib/audio.mc" // minc functions flow back into C as callbacks // (the C ABI is applied automatically): extern void set_log_handler(fn(u8*): void cb); void on_log(u8* msg) { /* ... */ } set_log_handler(on_log);
Native debugger (minc-dbg) for Windows, Linux, and macOS — no external gdb or lldb required. A VS Code extension provides syntax highlighting and integrated debugging, backed by a full language server (LSP) for go-to-definition, hover info, and live diagnostics.
Simple, fair pricing based on company size. No enforcement, honor system.
No DRM, no license keys, no phone-home. If your company makes over €100k/year and uses minc commercially, buy a license.