Makori
Makori is a compiled language for backend and systems work. You write .mko
files; Makori turns them into standalone native binaries — no garbage collector,
no VM, nothing extra to install next to them at runtime.
Renamed from Mako. The original name conflicted with
Python's Mako templating engine, which has
been around since 2006. To avoid confusion between the two projects, the
language is now called Makori. The mako command still works as a
backward-compatible alias, and the .mko file extension is unchanged —
existing code requires zero modifications.
Status: alpha (v0.7.3). It works, it compiles real programs, people have
built things with it. It is not stable. APIs will change, features are missing,
and there are bugs. If that's fine with you, read on.
mako-lang.com · Changelog · Roadmap · Status
Install
Linux
curl -fsSL https://github.com/loreste/mako/releases/latest/download/install-linux.sh | bash
source "$HOME/.local/share/mako/env.sh"
makori version
macOS
curl -fsSL https://github.com/loreste/mako/releases/latest/download/install-release.sh | bash
source "$HOME/.local/share/mako/env.sh"
Windows (PowerShell)
irm https://github.com/loreste/mako/releases/latest/download/install-windows.ps1 | iex
From source (needs Rust):
make install
makori version
You do not need Rust on the machine that runs Makori. The installer downloads a
prebuilt binary bundle.
macOS release binaries ship with a bundled linker (LLD) — no Xcode, clang,
or any external C toolchain is required. Install and build native binaries
out of the box. Linux currently requires gcc or clang for linking.
What it looks like
fn main() {
let ch = make(chan[string], 4)
crew t {
let p = t.kick(produce(ch))
for msg in range ch {
print(msg)
}
let _ = p.join()
}
}
fn produce(ch: chan[string]) -> int {
let _ = ch.send("hello")
let _ = ch.send("world")
ch.close()
return 0
}
makori init hello && cd hello
makori run main.mko
makori build --release main.mko -o hello
What actually works
Language. Static types with local inference. Result[T, E] and Option[T]
with ? propagation. Pattern matching with exhaustive checking and match guards.
Concise if let single-arm matching (if let Some(v) = opt { ... } else { ... }).
Enums with payloads. Generics (monomorphized). Interfaces (structural, like Go).
Closures with mutable captures. Tuples and multi-return. Integer literals in
decimal, hex (0xFF), binary (0b1010), and octal (0o77) with _ separators.
defer. Labeled loops. F-strings with stack builders. Struct update syntax.
Iterator combinators (xs.map(fn), xs.filter(fn), xs.reduce(init, fn) on slices)
with zero-allocation inline loop codegen. Variadic parameters (fn f(args: ...T)).
Compile-time file embedding (embed("file.txt") and embed_bytes("file.bin")).
Conditional compilation (#[cfg(os = "...")] / #[cfg(arch = "...")]).
Pipe operator (|>). prove contracts. live fn hot-reload foundation.
Contextual raw keyword and raw []T non-COW arrays for zero-atomic-overhead
hot paths (while allowing raw as an ordinary struct field or variable name).
Memory. Ownership tracking with compile-time move checks and position-aware
last-use move optimization. Multi-mention statement move safety: multiple accesses
in a single statement borrow or clone cleanly without premature zeroing.
Unconditional zero-initialization of struct and tuple stack temporaries, preventing
uninitialized padding bytes from leaking. Arenas for bulk allocation (arena
freed on scope exit). Bounds checks in debug and release. Escape analysis.
Deterministic cleanup with copy-on-write slices — no GC. The C backend shares
owned heap backing through atomic reference counts and detaches before
mutation; borrowed views and pool-backed buffers never enter that release
path. The native backend tracks owned and borrowed values explicitly across
calls and returns. Raw arrays (raw []T) opt out of COW entirely — plain
malloc backing, no refcount header, no atomic ops, single-owner move
semantics with unconditional free at scope exit. The ownership and runtime
safety model was introduced in 0.2.4 and continues to be hardened through
adversarial tests, sanitizers, leak checks, and regression gates. It is not
formally proven complete. unsafe and FFI are outside the model.
Concurrency & Parallelism. Structured concurrency with crew / kick / join
where ordinary crew jobs cannot outlive their scope (no orphan tasks).
Structured nursery cancellation policies: crew:all (wait all), crew:race / crew:any
(first to finish cancels remaining siblings), crew:fail_fast (child error cancels
siblings immediately), and crew(fail_fast=true). Zero-allocation small channels
via inline 4-slot ring buffers (inline_buf[4]) in MakoChan. Guaranteed blocking
client sockets on accept (tcp_accept, tcp_accept_nb, and unix_accept clear
inherited nonblocking flags from nonblocking listeners so worker threads do not
spin or hang on EAGAIN/EWOULDBLOCK). Typed channels (chan[int], chan[string],
chan[T]), select with timeouts and defaults, fan for parallel map.
Actors with mailboxes. No free go keyword — every spawned task has an owner.
Stdlib. HTTP/1.1 and HTTP/2 servers and clients with ALPN and chunked streaming.
TLS (OpenSSL) with multi-certificate SNI. WebSocket. JSON encoding and decoding
with streaming builders. SQLite and Postgres connection pools with transactions.
SIP parsing and building. HEP (Homer) ingest. UDP/TCP/Unix domain sockets.
Direct I/O (mako_dio) and memory-mapped files (MMap). File I/O. Regex (with RE2
backrefs and Unicode \p{L/N}). UUID and ULID. Base64. Binary buffers (Buf).
Prometheus metrics. Crypto (SHA-256, HMAC, PBKDF2, AEAD, DTLS 1.2 / SRTP, P-256).
Protobuf wire codec. gRPC unary frames and service registry. Application packs have
Go-equivalent surfaces (strings, bytes, io, os/env, net/netip, math/bits,
hash/crc32, crypto/rand, image, … — Makori names, not a syntax clone).
Coverage is detailed in STDLIB.md.
Backends. Native object code default (Cranelift). C backend
remains available via explicit --backend c as the oracle for sanitizers,
cross-compilation, and emit-c; unsupported native/LLVM modes hard-error instead
of silently falling back. Both backends produce standalone binaries. LLVM
release builds available with --backend llvm --release.
On macOS, the native backend ships with a bundled linker (LLD) — no clang or
Xcode required. On Linux, gcc or clang is needed for linking.
Packages. makori pkg manages dependencies with a lockfile, SHA-256 content
hashes, and SemVer resolution. Supports path deps, git deps, local registry,
and remote HTTPS registry. The default public registry is
https://loreste.github.io/mako-packages — makori pkg get <name> fetches
from it automatically. Packages can be signed with ed25519 and verified
on fetch.
Tooling & Observability. makori fmt, makori lint (including --identity),
makori test (with JSON reports and --coverage), makori check (with --json=v1
for IDE diagnostics), makori doc (API docs and search index), makori profile.
Deep developer tracing: hierarchical call trees (MAKO_TRACE=tree), Chrome Trace /
Perfetto timeline export (MAKO_TRACE_JSON=<path>), and channel operation telemetry
(MAKO_TRACE_CHAN=1), strictly zero-cost under release -DNDEBUG.
Interactive debugger integration with makori debug (LLDB with custom Mako formatters)
and makori dap (VS Code DAP protocol adapter). LSP server with completions,
go-to-def, references, rename, diagnostics, and inlay hints. VS Code extension.
Built with Makori
Zaman — live SIP/HEP operations with capture health, active-call state,
message inspection, site history, reports, alerts, and traffic metrics.


What does not work yet
- Linux native backend requires
gcc or clang for linking (installer handles this)
- WASM: WASI Preview 1 only — no sockets, no TLS, no Preview 2/WIT/DOM
- Sanitizers, cross-compilation, and emit-c require explicit
--backend c
- Full IDE visual breakpoint debugging is still maturing (
makori debug and makori dap provide command-line and DAP foundations)
- Stdlib coverage is uneven — some APIs are shape-only
- No stable ABI promise
- Package registry is public but has few packages; signing lacks key rotation and revocation
- Windows: ~21 test fixtures fail (filesystem semantics, signals, crypto paths); HTTP engine incomplete
- Package security model is not independently audited
STATUS.md has the full honest list.
New in 0.7.0
Generics parity — Mako's generics now match Rust's core feature set:
- Multi-bound generics:
fn f[T: Reader + Closer](x: T)
- Bounded generic structs/enums:
struct Repo[T: Storable] { ... }
- Interface inheritance:
interface Printable: Describable { ... }
- Default method bodies:
fn describe(self) -> string { return "unknown" }
- Methods on generic structs:
on Pair[T] { fn first(self) -> T { ... } }
- Where clauses:
fn f[T](x: T) where T: A + B { ... }
- Associated types:
interface Iterator { type Item; fn next(self) -> Option[Item] }
- Enum methods:
on Direction { fn name(self) -> string { ... } }
- Fixed-size arrays:
let buf: [int; 8192] — const generic array types
- Dynamic dispatch foundation: vtables, fat pointers, and heterogeneous interface arrays
Systems programming:
- Thread-local storage:
thread_local let conn_id: int = 0
- Packed structs:
#[packed] struct PageHeader { ... } — exact byte layout
- Process control:
process_fork, process_exec, process_wait, process_pipe, process_dup2, process_setsid
- Hypervisor primitives:
ioctl, mmap_anon, munmap, mprotect, mem_read/write_i64/i32/byte
- Scatter-gather I/O:
writev, sendmsg, sendfile — zero-copy block transfers
- SIMD + bit ops:
simd_f32x4_dot, simd_fma, clz, ctz, popcount, bswap64, rotl64
- Real-time safety:
#[no_alloc] — compiler rejects heap allocation in annotated functions
Memory safety:
- COW refcount leak: struct field replacement with same-pointer COW clones now releases the extra reference (3 codegen sites fixed)
- View-to-owned tracking: slice views promoted to owned via append are now freed at scope exit
- JSON derive leak fix:
json_merge, json_b, json_object_str now free intermediate temporaries
- DCE enum retention: unit enum variants used as values no longer stripped
- DCE method retention: methods on reachable types are BFS-walked so transitive deps survive
- GCC 14+ compat: const-cast all
_of array helper call sites
New in 0.6.38
- Refcounted strings:
mako_str_clone is O(1) — atomic refcount bump instead of malloc + memcpy. FayDB-class workloads see major read throughput improvements.
- Memory safety fixes: DCE preserves struct types referenced only via field types;
__mako_sp_* element pointers properly scoped in while loops; struct array literals with variable elements use move-or-clone to prevent double-free and leaks.
- Worker pool stack size: Pool threads now use the same 8 MB stack as direct-spawned tasks, fixing stack overflow on recursive SQL evaluation (UNION queries).
- Windows first-class: One-liner PowerShell installer; SQL/crypto/network tests skip gracefully when platform libraries are unavailable; quarantine reduced from 18 to 14 tests.
- Native bridge RC handling: Borrowed strings set
_rc=0; taken strings copy RC data into plain buffers for native ownership.
New in 0.6.35
- Actor early return in receive arms:
return inside a receive