4 ms·
Rust should seriously stop using macros for everything.
by cute_boi 1y ago
Rust should seriously stop using macros for everything.
- kaashif 1y agoI agree with this. It appears that in this case, macros are a band-aid over missing features in the type system. I feel like structural typing or anonymous sum types would solve this problem without macros. I mean given A = X | Y and B = X | Y | Z, surely the compiler can tell that every A is a B?
- estebank 1y agoThis has problems as soon as it hits generics and lifetimes. That being said, I think a limited version of the feature that disallows the the same type with divergent lifetimes or even all generics would still be useful and well liked.
- nixpulvis 1y agoWhat's wrong with macros? Especially attribute style macros which apply to variants of an enum allow a lot of code expansion which reduces boilerplate a lot.
- pjmlp 1y agoIncrease of compile times, on a already blazing fast compiler. Debugging, especially when it lacks the tooling of a Lisp or Scheme REPL/IDE.