3 ms·
Nim has one of the most powerful metaprogramming systems out there. Hygienic templates, easy macros, but my favorite is the compile-time functions. Nim compile
by archargelod 1y ago
Nim has one of the most powerful metaprogramming systems out there.
Hygienic templates, easy macros, but my favorite is the compile-time functions.
Nim compiler has an embedded VM, so any Nim code (that doesn't rely on FFI) can run at compile time.
- simonask 1y agoI'm sure that's nice, but it's not a game changer. You can do metaprogramming in other languages as well, and maybe those languages get it not quire as right as Nim, but it's not enough to tip the scales.
- lionkor 1y agoMore powerful than zig's comptime?
- Tiberium 1y agoYes, compile-time execution in Nim is very natural, if you mark a variable "const" or use some other ways, you can run almost all pure-Nim code at compile-time without having to modify it.