4 ms·
I'm more disappointed by someone who thinks that Rust macros are better than Zig comptime. Rust macros are, IMO, one of the weakest parts of the language. Sur
by bsder 2y ago
I'm more disappointed by someone who thinks that Rust macros are better than Zig comptime.
Rust macros are, IMO, one of the weakest parts of the language. Sure, you can do anything. To do so, you have to atomize down to lexical atoms, rearrange everything, and feed a new set of lexical atoms back into the stream. And to do so, you have to pull in a bunch of crates related to syntax analysis that should really be a fundamental part of the compiler and are welded to the specific Rust version. Bleargh!
Zig comptime has been a real breath of fresh air. It's great that it runs at compile time, and, if I need to debug it, I can generally force it to be runtime code. You write the same code you were going to write anyway without creating weird meta-languages that have a magic expansion phase that is impossible to debug.
- pdimitar 2y agoI agree about Rust macros. Hopefully they'll upstream stuff like `syn` (and hyper-optimize it) in the future. I appreciate the code generation abilities Rust macros give me but hell, they are difficult to wrap your head around even if you worked with them multiple times.