Skip to content

Quick start

Run these commands inside the cloned repository (see Installation). If you set up the um command, you can use um in place of node src/cli.ts.

Terminal window
node src/cli.ts build examples/structs.um --target host -o structs
./structs # prints 32, 1.5, 2.5, 3.5, 7, 1

A native executable that runs kernels on the GPU through Metal:

Terminal window
UM_METAL=1 node src/cli.ts build examples/gpu_submit.um --target host -o gpu_submit
./gpu_submit # prints 30, true, 285, 3

wasm32 is the default target. It needs a wasm32-capable clang.

Terminal window
node src/cli.ts build examples/structs.um -o structs.wasm
node runtime/run-node.mjs structs.wasm
Terminal window
node src/cli.ts check examples/structs.um

Add --json for machine-readable diagnostics.

Terminal window
node src/cli.ts build examples/kernels.um --emit-llvm -o kernels.ll
node src/cli.ts build examples/kernels.um --target host --emit-msl -o kernels # kernels.<name>.metal