Re:Interview with Zig language creator Andrew Kelley [video]
by mratsim on Tuesday September 08, 2020 @11:42AM
(#24409486)
In Nim the equivalent is using a `static:` block, then everything inside has normal Nim syntax but evaluated at compile-time.
You can also do `const a = static(foo(x, y, z))` to force normal function to be evaluated at compile-time and store them in a constants.
Hence you don't need to use macros for compile-time evaluation in Nim just like in Zig. However macros are necessary for AST manipulation.
See my comment here about "Zig' ": https://news.ycombinator.com/item?id=24293611
Perhaps now you see what I meant when I said that Zig's simplicity hides its radical design.