News for hackers. Stuff that matters.
Re:Show HN: Gojay – Performant JSON encoder/decoder for Golang by pcwalton on Sunday May 20, 2018 @04:20PM (#17114558)
Macros usually make debugging easier than code generators do. That's because quasiquote and similar operators let you debug code, not code that generates code.

I'm the first to admit that macros have downsides compared to not having them in the language, but ease of debugging generated code isn't one of those downsides.

Re:Show HN: Gojay – Performant JSON encoder/decoder for Golang by stcredzero on Sunday May 20, 2018 @09:58PM (#17115730)
I've generally found that C/C++ macros make debugging harder. Debuggers don't always deal with debugging them the most straightforward thing.

That's because quasiquote and similar operators let you debug code, not code that generates code.

What I've found is that you can debug the generated code to debug the code generator. Code generators shouldn't be used to do something terribly complicated. I'd agree with you that code generators doing complicated things is a code smell. Leave those to native syntax, provided it's not as badly thought out as templates.

Re:Show HN: Gojay – Performant JSON encoder/decoder for Golang by phamilton on Sunday May 20, 2018 @10:03PM (#17115746)
> C/C++ macros

I'd argue that those aren't first class macros. C macros are just source manipulators, and C++ templates (I'm not super experienced with them so forgive come if I'm way off) don't really manipulate the AST, it's more a type system with compile time resolution.