| Section | Title |
|---|---|
| 1 | What comptime Means |
| 2 | Compile-Time Parameters |
| 3 | Types as Values |
| 4 | Inline Loops |
| 5 | Reflection |
| 6 | Generating Declarations |
| 7 | Exercises |
What `comptime` MeansA Zig program runs in two stages.
Compile-Time ParametersA function parameter can be marked comptime.
Types as ValuesIn Zig, a type is a value.
Inline LoopsA normal loop runs while the program runs.
ReflectionReflection means inspecting a type from inside the program.
Generating DeclarationsA Zig function can return a type.
Exercises1. Write a program that computes several Fibonacci numbers with comptime. Print the results at runtime.