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.
Native executable
Section titled “Native executable”node src/cli.ts build examples/structs.um --target host -o structs./structs # prints 32, 1.5, 2.5, 3.5, 7, 1GPU through Metal (Apple Silicon)
Section titled “GPU through Metal (Apple Silicon)”A native executable that runs kernels on the GPU through Metal:
UM_METAL=1 node src/cli.ts build examples/gpu_submit.um --target host -o gpu_submit./gpu_submit # prints 30, true, 285, 3WebAssembly
Section titled “WebAssembly”wasm32 is the default target. It needs a wasm32-capable clang.
node src/cli.ts build examples/structs.um -o structs.wasmnode runtime/run-node.mjs structs.wasmType-check only
Section titled “Type-check only”node src/cli.ts check examples/structs.umAdd --json for machine-readable diagnostics.
Inspect generated code
Section titled “Inspect generated code”node src/cli.ts build examples/kernels.um --emit-llvm -o kernels.llnode src/cli.ts build examples/kernels.um --target host --emit-msl -o kernels # kernels.<name>.metalNext steps
Section titled “Next steps”- The programs in Examples are runnable; each one doubles as a test (
// expect:lines). - Read the language guide.
- Set up your editor.