Hacker News new | past | comments | ask | show | jobs | submit login

> "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.




Yes, I do see macros as a possible alternative to generics, but not sure if it would ever happen.


Macros 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.


I know, but they surely would be a better solution than "go generate", as I doubt Go will ever have generics.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: