tape build
Usage
bash
tape build <file.tape> -o <output> [options]Examples
bash
tape build app.tape -o app.exe # Windows executable
tape build app.tape -o app --target linux # Linux ELF64
tape build app.tape -o app --target uusi # Uusi ELF64
tape build app.tape -o app --target macos-arm64 # macOS ARM64 Mach-O
tape build lib.tape -o lib.dll --dll # Windows DLL (with exports)
tape build lib.tape -o lib.sto --sto --target uusi # Uusi shared object
tape build lib.tape -o lib.o --sto --target linux # Linux relocatable objectOptions
| Flag | Description |
|---|---|
-o <path> | Output file path (required) |
--target <t> | Target platform: win64, linux, macos, macos-arm64, uusi (default: host) |
--dll | Emit as shared library (DLL on Windows, object on macOS/Linux) |
--sto | Emit as shared/relocatable object (STO on Uusi, .o on Linux/macOS) |
--skip-link-check | Skip @link library/symbol verification |
-I <path> | Add module search path (for imports) |
--human | Human-readable errors with color, source context, and carets (default: LLM-friendly terse format) |
--max-errors <N> | Stop after N errors (default: unlimited) |
Build process
- Split source into regions (
#code,#view, etc.) - Parse
#coderegion (with rt0 preamble if no imports) - Parse
#viewregion, merge components into module - Resolve imports (if any) → parse dependencies recursively
- Execute
@tapeblocks (compile-time metaprogramming) - Type check
- Lower to TAC IR
- Verify
@linkreferences (unless--skip-link-check) - Native codegen (x86-64 or ARM64 depending on target)
- Emit binary (PE64, ELF64, or Mach-O)
Runtime preamble
For simple programs without imports, the compiler prepends a minimal runtime preamble that declares platform-specific extern functions (e.g. WriteFile/ExitProcess on Windows, __syscall1..__syscall6 on Uusi). If the source has import statements, the preamble is skipped — the runtime library provides these through tapert100.
Cross-compilation
The compiler can target any supported platform from any host:
bash
# On Windows, build for Uusi:
tape build kernel.tape -o kernel --target uusi
# On Windows, build for Linux:
tape build server.tape -o server --target linux
# On any host, build for macOS ARM64:
tape build app.tape -o app --target macos-arm64Output by target and flags
| Target | Default | --dll | --sto |
|---|---|---|---|
win64 | PE64 executable | PE64 DLL (export table) | — |
linux | ELF64 executable (dynamic linking) | Relocatable .o | Relocatable .o |
macos | Mach-O executable | Mach-O object | Mach-O object |
macos-arm64 | Mach-O executable (ARM64) | Mach-O object | Mach-O object |
uusi | ELF64 executable (static, syscalls) | — | STO (vtable exports) |
Last modified: