Hacker News new | ask | show | jobs
by stefano 6214 days ago
C++ templates are similar to macros: they run at compile time to generate code, but they're a lot harder to use.
1 comments

True, but in this case, the template serves a different purpose from the macro. It's there to make zap polymorphic, and would be unnecessary in a dynamic or type-inferred language. The main point is that pg's macro can be implemented as an ordinary function in a language that has references.