3 ms·
> "go generate" AKA macros. I wish they were at least intellectually honest and just call them "macros" and start nice supporting hygienic macros in the langu
by rdtsc 12y ago
> "go generate"
AKA macros.
I wish they were at least intellectually honest and just call them "macros" and start nice supporting hygienic macros in the language.
- pjmlp 12y agoYes, I do see macros as a possible alternative to generics, but not sure if it would ever happen.
- masklinn 12y agoMacros are not an alternative to generics, they're an alternative to C++'s template specialisation. Most languages with generics don't provide for user-controlled code generation via generics (if they do generics-based codegen at all, IIRC GHC uses erased generics for instance). They tend to use macro systems or preprocessors instead.
- pjmlp 12y agoI know, but they surely would be a better solution than "go generate", as I doubt Go will ever have generics.