Getting Started
OverviewLanguage GuideFull Reference
Book
Table of ContentsIntroductionPrefaceGetting StartedLanguage TourOwnershipErrorsConcurrencyStdlibNetworkingDataPackagesSpeed & SafetyCross-PlatformToolingCookbookAppendix
Reference
Standard LibraryKeywordsPerformanceSecurityBuilt-in FunctionsStatusDebuggingABI
How-To
Getting StartedHTTP APIsErrorsPackagesConcurrencyMemoryWASITestingRelease Builds
Project
RoadmapVisionChangelogContributing

Debugging Mako

Debug builds are the default (mako build / mako run / mako test use clang -O0 -g). Release: mako build --release (-O2, still linkable).

lldb / gdb

mako build examples/hello.mko -o /tmp/hello
lldb /tmp/hello          # macOS
# or: gdb /tmp/hello     # Linux
(lldb) run
(lldb) bt                # backtrace on crash

Runtime aborts print error: … plus a pointer to this doc. Prefer Result + ? over panicking for expected failures.

dbg / dbg_str

let x = dbg(n)           // stderr: [dbg] file.c:LINE: n = 42
let s = dbg_str(msg)

Emits to stderr with __FILE__/__LINE__ from generated C (maps to the compiled unit). Keep in debug sessions; remove or gate for production logs.

Tests

mako test examples/testing -v

Failures show assert_eq failed: got N, want M (and test name). Subtests use t_run.

Sanitizers

mako build main.mko --sanitize=address
mako build main.mko --sanitize=thread

Errors

See GUIDE § Errors: error / errorf / wrap_err / error_is / error_string / ?.

Edit this page on GitHub Report an issue