|
|
|
|
|
by throwawaymaths
527 days ago
|
|
zig comptime is not a macro system and you can't really generate code in a way that makes hygeine a thing to worry about (there is no ast manipulation, you can't "create variables"). the only sort of codegen you can do is via explicit conditionals (switch, if) or loops conditioned on compile time accessible values. thats still powerful, you could probably build a compile time ABNF parser, for example. |
|
[1]: https://github.com/vlang/v/blob/master/doc/docs.md#compile-t...