2026-03-24 19:18 UTC
@lunathemoongirl@cailincat.cloud yeah, compile time code execution (comptime for short) is used a lot in zig, for conditional compilation, generic data types, and type reflection. For example, the growable array in zig's standard library is a function that takes a type and returns a type. If you wanted a list of u8s, you would use std.ArrayList(u8).
One of the quirky language features that enables this is lazy compilation. Zig won't analyze code unless it is actually used.
Replies (0)
No replies.