News for hackers. Stuff that matters.
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.

There are no comments on this comment yet.