This guide walks you through installing Mako, creating a project, and running your first program. By the end you will have a working development loop.
# macOS
curl -fsSL https://github.com/loreste/mako/releases/latest/download/install-release.sh | bash
source "$HOME/.local/share/mako/env.sh"
# Linux
curl -fsSL https://github.com/loreste/mako/releases/latest/download/install-linux.sh | bash
source "$HOME/.local/share/mako/env.sh"
Pin a version: --version v0.2.3. Needs clang so .mko files can compile.
make install # requires cargo/rustc + clang
This places the mako binary in ~/.local/bin/ and runtime headers in
~/.local/share/mako/runtime. Ensure ~/.local/bin is on your PATH.
Verify the installation:
mako version
# mako version mako0.6.2 darwin/arm64
mako version -v
# includes the git commit hash
Makori provides scaffolding for three project shapes:
# Simple application
mako init hello --name hello
# Backend API service (includes HTTP handler scaffold)
mako init mysvc --backend
# Multi-package workspace (lib + app)
mako init myws --workspace
Each creates a directory with mako.toml and a main.mko entry point.
After makori init hello --name hello:
hello/
mako.toml # package manifest (name, version, dependencies)
main.mko # entry point — must contain func main() / fn main()
The mako.toml looks like:
name = "hello"
version = "0.1.0"
Open hello/main.mko (Mako-native syntax preferred):
fn main() {
print("hello from mako")
print_int(fib(10))
}
fn fib(n: int) -> int {
if n <= 1 {
return n
}
return fib(n - 1) + fib(n - 2)
}
Identity guide: IDENTITY.md.
Dual forms (func, :=, …) still work for compatibility.
From inside the hello/ directory:
# Typecheck without compiling (fast feedback)
mako check main.mko
# Compile and run in one step
mako run main.mko
# Build a binary (name comes from mako.toml)
mako build main.mko
# Run the binary directly
./hello
mako run main.mko -- arg1 arg2
Inside the program, use argc(), arg_get(i), or args() to read them.
| Command | Purpose |
|---|---|
makori check file.mko |
Typecheck (incremental, fast) |
makori run file.mko |
Compile and execute |
makori build file.mko |
Produce a binary |
makori build --release file.mko |
Optimized release binary |
makori build -j 8 file.mko |
Parallel compilation |
makori test path/ |
Run tests |
makori fmt file.mko |
Format source code |
makori version |
Print version and platform |
If you have not installed yet, run directly from the compiler source tree:
cargo run --release -- check examples/hello.mko
cargo run --release -- run examples/hello.mko
| Variable | Purpose |
|---|---|
MAKO_RUNTIME |
Override runtime header location |
MAKO_JOBS |
Default parallel job count (same as -j) |