Version: 1.1.0
Compile-time cheat sheet
Facts you give the compiler.
Essentials
- Parameters live in square brackets.
aliasnames a compile-time constant or type.comptime ifandcomptime forrun during compilation.comptime assertfails the build.- A parameter used in ordinary code becomes a runtime constant.
Example
alias N = 4
fn main():
comptime assert N == 4
print(N)
Keep in mind
Compile-time code must be free of I/O that depends on a particular machine state unless that state is the target itself.