Tests and layout
node tests/run.tsThis runs each program in examples/ on wasm32 and natively on this machine and compares the output (against the // expect: lines; lines written as // stdin: line are given as standard input), and checks object generation for arm64 macOS. Where AddressSanitizer or valgrind is available (AddressSanitizer and leaks on a Mac), it also runs with memory checking to confirm there is no use after free, out-of-bounds access, double free or leak. It also checks code that must fail to compile (tests/errors/) and code that must stop (tests/panics/). Thread tests (tests/threads/, native only) are also run under ThreadSanitizer to confirm there are no data races. tests/metal/ runs on Metal on a Mac and is compared with the CPU results; elsewhere it only checks that it can be built for arm64.
- There is no option to run a single test. To check one, build and run that file and compare its output with the
// expect:lines. - wasm32 tests are skipped where there is no wasm32-capable clang (such as Xcode’s clang on a Mac).
Layout
Section titled “Layout”src/lexer.ts lexical analysissrc/parser.ts parsingsrc/checker.ts type and borrow checking, kernel restrictions, constant evaluationsrc/codegen.ts LLVM IR (text) generationsrc/msl.ts kernel to MSL (Metal) translationsrc/wgsl.ts kernel to WGSL (WebGPU; experimental) translationsrc/driver.ts invoking clangsrc/cli.ts commandsruntime/ runtimes for native (native.c), Metal (metal.m) and wasm (wasm_rt.c and host.mjs, including running on WebGPU), and the standard functions (prelude.um)assets/logo/ logo (SVG and PNG)examples/ runnable samples (also tests)tests/ test runner, and cases for errors, panics, threads, Metal, MSL and moredocs/ this guideThe project’s own security policy is in SECURITY.md.