3 ms·
"Crystal has a wonderful and extremely ergonomic macro system that Rust could learn from, one that doesn’t require ad-hoc reinterpretation of language tokens an
by skywal_l 5y ago
"Crystal has a wonderful and extremely ergonomic macro system that Rust could learn from, one that doesn’t require ad-hoc reinterpretation of language tokens and that integrates seamlessly with syntax highlighting in editors".
What about zig, where there is no macros per-se, and you just write zig code which is then interpreted by the compiler...
- woodruffw 5y agoAuthor here: I haven't written any Zig, but I've read a little bit about `comptime` (which I thought was very cool). I like compile-time programming, but I also recognize that it's programmer catnip: we love it because it lets us be clever, including in ways that aren't conducive to maintainability. That's a big part of why I like Crystal's macro system: I think it does a good job of balancing readability, expressivity, but also constraining the programmer away from compile-time gymnastics. But like I said, I have no Zig experience, so it's very possible that Zig has much better ergonomics than I'm afraid of!